Commit Graph

572 Commits

Author SHA1 Message Date
Benjamin Otte
4f23dc34be window: Make non-resizable windows use default size for geometry hints
Previously, we were trying to size them by the default size, but then
setting the minimum size as the geometry hints' minimum and maximum
size.
2011-05-01 08:47:58 +02:00
Benjamin Otte
406b2e9e58 window: Remove overeagerness with new size guessing
Don't use the guessed size when we are interested in the minimum size.
So now we can really shrink menubars.

This reverts parts of 08b2ac1d90
2011-05-01 08:02:15 +02:00
Benjamin Otte
7962a4b716 window: Invert check that was wrong 2011-04-29 03:27:02 +02:00
Benjamin Otte
1763b3a0b5 window: Make comparison be the right direction
Messed something up there...
2011-04-27 15:27:52 +02:00
Benjamin Otte
85aebe74cf window: Be smarter about computing the default size
See the code comments for the reasoning behind this. After we don't
force a "guessed" minimum size for labels anymore, a lot of issues
started to surface that this patch attempts to fix. In particular:

1) Tooltips where wrapped as much as possible.
2) The recentchooser submenu displayed only ellipsize dots.
2011-04-27 00:27:29 +02:00
Benjamin Otte
08b2ac1d90 window: Split out size guessing function
This doesn't do anything special yet, but I'm about to change that.
2011-04-26 23:15:19 +02:00
Benjamin Otte
6e6837a130 window: Use int instead of uint consistently 2011-04-26 22:44:43 +02:00
Javier Jardón
9d63d16e3e Move documentation to inline comments: GtkWindowGroup 2011-04-18 02:08:37 +01:00
Benjamin Otte
7ef113ce56 window: Only draw the resize grip if it is actually visible
This issue can only be seen if someone calls gtk_widget_draw() on the
window as otherwise gtk_cairo_should_draw_window() would return FALSE.
2011-04-16 22:31:24 +02:00
Benjamin Otte
6b712ac93b window: cast value so gcc shuts up 2011-04-16 22:06:41 +02:00
Dan Winship
b5d678dab0 gtk_window_present_with_time: fix when window is not initially visible
When called on a hidden window, gtk_window_present_with_time() would
just fall back to gtk_widget_show(), completely ignoring the passed-in
timestamp. This ended up working anyway if the timestamp came from
in-process, since gdk_window_x11_show() would initialize its user_time
from the time of the most recent event. But if the timestamp came from
another process, this would result in the window being shown with an
out-of-date timestamp.

Fix this by remembering the timestamp from
gtk_window_present_with_time(), and then setting the GdkWindow's
user_time from that when it the window is realized.

https://bugzilla.gnome.org/show_bug.cgi?id=647275
2011-04-12 13:03:38 -04:00
Kristian Høgsberg
c7514e8f0d Merge branch 'gdk-backend-wayland'
Conflicts:
	Makefile.am
	configure.ac
	gdk/Makefile.am
	gtk/gtksettings.c
	gtk/gtkwindow.c
2011-04-12 09:52:44 -04:00
Matthias Clasen
3fbfd82e9e GtkWindow: rearrange private struct to fill some holes 2011-04-11 18:33:43 -04:00
Tristan Van Berkom
0b8a1dcac2 Fixed warning catch in gtk_window_compute_hints(). 2011-04-03 18:10:27 +09:00
Florian Müllner
16dc117045 window: Use settings from screen rather than default
gtk_settings_get_default() was used to monitor the
"gtk-application-prefers-dark-theme" setting, rather
than the GtkSettings object associated with the window's
screen.
2011-03-25 17:41:19 +01:00
Florian Müllner
3032fdce2a window: Export theme variant to X11
The metacity theme format allows to use colors from the current
GTK+ theme in window decorations. Since GTK+ now gained support
for dark theme variants, window managers using that theme format
(metacity, mutter, compiz via gtk-window-decorator) should be able
to use colors from the correct variant; so in case a variant is
requested, export it in the _GTK_THEME_VARIANT property on
toplevel windows.

https://bugzilla.gnome.org/show_bug.cgi?id=645354
2011-03-21 15:06:34 +01:00
Matthias Clasen
ddc588236b Add annotations to gtk_window_get_position
Part of bug 644353, patch by Ulrik Sverdrup.
2011-03-12 21:25:07 -05:00
Cosimo Cecchi
4a99e75ce7 window: don't confuse priv->type_hint with priv->gdk_type_hint
This broke, among the others, menu rendering.
2011-03-03 17:48:25 -05:00
Benjamin Otte
7693804fcf window: Add check for X11 window when calling x11 function 2011-03-02 17:29:21 +01:00
Kristian Høgsberg
287d91e5f9 Merge remote-tracking branch 'origin/master' into gdk-backend-wayland
Conflicts:
	gdk/gdkdisplaymanager.c
2011-02-26 14:44:29 -05:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Kristian Høgsberg
b4129c14cb gtkwidget: Only call X GDK functions when the window is an X window 2011-02-10 13:44:45 -05:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Matthias Clasen
4dc9b294d8 Don't assume a screen exists before realize()
Fix for https://bugzilla.gnome.org/show_bug.cgi?id=641429
2011-02-04 22:03:11 -05:00
Benjamin Otte
fac914d70c API: gtk: Remove client_event vfunc from GtkWidget
Also remove the (de-facto unused) implementation from GtkWindow that was
only used for sockets/plugs.
2011-02-01 06:33:01 +01:00
Kristian Rietveld
9dcdca2501 Don't use GTK_IS_PLUG for non-X11 backends 2011-02-01 00:26:04 +01:00
Benjamin Otte
63aa56bcc4 window: Get rid of GdkNativeWindow usage
Make _gtk_window_add_embedded_xid() and
_gtk_window_remove_embedded_xid() take a Window.
2011-01-28 17:06:07 +01:00
Benjamin Otte
e1f6a24da9 window: Make embedded xid specific to the X11 backend 2011-01-28 17:06:07 +01:00
Benjamin Otte
5a1755bc50 gtk: Prefix gtk_window_add_embedded_xid() with underscore
It's a private API after all.
Same thing for gtk_window_remove_embedded_xid().
2011-01-28 17:06:07 +01:00
Matthias Clasen
7db4bee4b6 Clarify documentation about application vs window lifecycle
https://bugzilla.gnome.org/show_bug.cgi?id=639931
2011-01-24 22:20:35 -05:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
a1c297a310 [GI] Cosmetic cleanups of annotations and doc comments
This change does not introduce any functionality change, mostly
cosmtic cleanups, like re-linebreak when introduced annotations messed
up indentation or whitespace errors fixes.
2011-01-18 17:31:59 +01:00
Pavel Holejsovsky
fe372ddf5e [GI] Add missing (allow-none) annotations 2011-01-18 17:30:43 +01:00
Pavel Holejsovsky
6d5cdad56e [GI] Annotate strings holding file paths as (type filename) 2011-01-18 17:29:40 +01:00
Garrett Regier
cb0fac73a5 Fix memory leak in gtk_window_group_list_windows 2011-01-17 08:23:59 -08:00
Matthias Clasen
efd0e6ec1f Add a setter for GtkWindow.has_user_ref_count
This is needed for some language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=638880
2011-01-10 11:49:06 -05:00
Carlos Garnacho
f506fc3e93 Remove recent GtkStyle usage in GtkWindow
GtkStyleContext API is used instead.
2011-01-10 03:49:59 +01:00
Matthias Clasen
c396c52327 Documentation fixes 2011-01-06 08:12:01 -05:00
Tristan Van Berkom
44a9b1c35e Fixed statement in gtkwindow.c when toplevelness changes.
Fixed a typo when checking if the heirarchy toplevel is a toplevel
before firing the hierarchy-changed signal.
2011-01-06 14:39:41 +09:00
Tristan Van Berkom
a28295a742 Dont show the GtkWindow when removing it from a parent and becomming a toplevel
Showing the window causes it to try to grab focus, this causes problems
when embedded toplevels run through dispose cycles.
2011-01-06 14:39:41 +09:00
Tristan Van Berkom
b8c8f2ccb1 Fixed conflict while rebasing master. 2011-01-06 14:39:41 +09:00
Tristan Van Berkom
93c8058582 Fixed GtkWindow/GtkWidget to properly emit hierarchy changed for embedded toplevels
Now GtkWindow takes some measures when setting toplevelness:

  - When a window becomes toplevel after being embedded it saves
    the visibility state and reshow's itself so that the window
    re-realizes and presents itself again automatically

  - When emitting hierarchy-changed, synthetically mark the toplevel
    as not anchored, this allows the hierarchy changed propagation to
    recurse properly.

GtkWidget also takes care to unset the parent window *after* unparenting
the widget and after emitting the heirarhcy changed that leaves a NULL
toplevel.

That means there are now 2 cycles of "hierarchy-changed" when removing
an embedded toplevel from a parent, first one that makes the new toplevel
a NULL one (since the toplevel flag is not yet restored), the second cycle
makes the removed window toplevel again when setting the parent window
to NULL.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
aa787c9dd1 Fixed focus handling on embedded windows.
Now GtkWindow chains up in focus vfuncs when non-toplevel, this
fixes focus in testtoplevelembed.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
fdba9f281d Fixed issues with "hierarchy-changed" signal.
GtkFileChooserDefault watches the toplevel and montitors "set-focus"
signal on it... however the connection needs to be remade when the
GtkFileChooserDialog is in an embedded toplevel.

Measure's taken: GtkWindow propagates hierarchy changes when
_gtk_window_set_is_toplevel() is called, gtk_widget_unparent()
unsets the widget's parent window earlier in the function so that
the possible hierarchy change is still able to properly access the hierarchy.

GtkFileChooserDefault checks if the "new" toplevel is indeed
gtk_widget_is_toplevel() but not the old one, GtkRange has been
updated to use gtk_widget_is_toplevel() inside it's hierarhcy_changed
vfunc, other classes already do this properly.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
addcc64b9c Slightly less special casing in GtkWindow for gtk_widget_is_toplevel()
Also take care of setting the resize-mode at realize time depending
on toplevelness.
2011-01-06 14:39:40 +09:00
Tristan Van Berkom
8b4b62f00c Allow GtkWindow to be parented if gtk_widget_set_parent_window() is called on one
This patch makes gtk_widget_set_parent_window() undo the toplevelness
of a GtkWindow, GtkWindow then realizes itself as a normal child widget
and behaves like a normal GtkBin by checking gtk_widget_is_toplevel() in
several places (show/hide/map/unmap/draw/size_allocate/check_resize/configure_event).
2011-01-06 14:39:40 +09:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00