Zero width/height is unsupported and will magically be turned into one.
For instance, gtk_widget_size_allocate() will eventually do this magic
on the value stored in widget->allocation.
However, if we don't do this magic conversion early, then the value
returned from gtk_window_compute_configure_request() will not be
comparable with whats stored in widget->allocation. (I.E. they will
differ if width or height are zero).
This is dangerous, as we do such a comparison in gtk_window_move_resize().
Currently a change from e.g. 10x1 (current allocation) to 10x0 (new size)
will be expected to produce a ConfigureNotify, when it actually won't,
thus never thawing the frozen toplevel.
Fixes bug #588059
For non-realized windows we set the user_time from the startup id on
realization. However, if the window is already realized when the
startup_id is not set we currently don't, but we should. (#573922)
Patch by Federico Mena Quintero
* gtk/gtkwindow.h:
* gtk/gtkwindow.c (_gtk_window_set_is_toplevel): New internal
function used when a GtkPlug parents/unparents itself by an
in-process GtkSocket. This keeps the plug's GTK_TOPLEVEL flag in
sync with the global toplevel_list.
* gtk/gtkplug.c (gtk_plug_set_is_child): Call
_gtk_window_set_is_toplevel() to keep the toplevel list updated,
instead of just setting/unsetting the GTK_TOPLEVEL flag.
svn path=/trunk/; revision=22191
* gtk/gtkwindow.c (gtk_window_set_icon_name): Don't cause lots
of X traffic when the icon name doesn't actually change. Some
apps like to reset their window icon frequently, without actually
changing the icon name...
svn path=/trunk/; revision=22103
* gtk/gtkmenuitem.c: Made buildable and added support for adding children
of type "submenu"
* gtk/gtkwindow.c: Added support for custom tag "accel-groups" to add GtkAccelGroups
to the window.
* gtk/gtkcontainer.c: Added builder contextual warnings in buildable_add_child()
* gtk/tests/builder.c: Added tests for buildable menus (test that accelerators are
properly connected on stock items, test the menu hierarchy, test permission to
add alien/custom menuitem children).
* docs/reference/gtk/tmpl/gtkbuilder.sgml, docs/reference/gtk/tmpl/gtkwindow.sgml,
docs/reference/gtk/tmpl/gtkmenuitem.sgml: Updated docs for buildable submenus
and accel groups.
svn path=/trunk/; revision=21767
2008-10-13 Matthias Clasen <mclasen@redhat.com>
Bug 552318 – menubar mnemonics consumed even when
gtk-enable-mnemonics=false
* gtk/gtkwindow.c (gtk_window_activate_key): Don't let mnemonic
entries block accelerator activation when gtk-enable-mnemonics is
FALSE. Problem reported by Andreas Moog.
svn path=/trunk/; revision=21648
2008-08-12 Michael Natterer <mitch@imendio.com>
* gtk/*.c: consistently chain up using
GTK_FOO_CLASS(parent_class)->bar(instance) instead of
(*GTK_FOO_CLASS(parent_class))->bar(instance).
svn path=/trunk/; revision=21085
2008-08-05 Tor Lillqvist <tml@novell.com>
Bug 544684 - Win64 issue, window handles are assumed to be 32-bit
* gtk/gtkwindow.h
* gtk/gtkwindow.c: Change the type of the xid parameter of the
internal gtk_window_remove_embedded_xid() and
gtk_window_add_embedded_xid() functions from guint to
GdkNativeWindow.
* gtk/gtkwindow.c (send_client_message_to_embedded_windows):
Instead of GPOINTER_TO_UINT(), just cast the gpointer to
GdkNativeWindow. GPOINTER_TO_UINT() drops the upper 32 bits on
Win64.
svn path=/trunk/; revision=20992
2008-08-04 Michael Natterer <mitch@imendio.com>
* gtk/gtkwindow.c: move the code of the deprecated
gtk_window_set_policy() to a new private function
gtk_window_set_policy_internal() and call it from
gtk_window_set_policy().
(gtk_window_set_resizable): use the new internal function in order
to avoid our own deprecated public API.
svn path=/trunk/; revision=20965
2008-07-31 Cody Russell <bratsche@gnome.org>
Bug 56070 – Can't click button after setting it sensitive.
* gtk/gtkwidget.[ch]
* gtk/gtkwindow.c
* gtk/gtkmain.c
* gtk/gtkbutton.c
* gtk/gtkprivate.h
* gdk/gdkevents.h: Synthesize crossing events events where necessary.
* gtk/tests/crossingevents.c: Add unit tests for crossing events.
Big thanks to Ed Catmur, Matthias Clasen, and everyone else who
has worked on and helped out with this.
svn path=/trunk/; revision=20924
2008-06-30 Cody Russell <bratsche@gnome.org>
* Practically everything changed.
Change all references of GIMP Toolkit (and variations of it)
to GTK+ Toolkit, showing no mercy at all to our beloved
ancestry. (#540529)
svn path=/trunk/; revision=20709
* gtk/gtkwindow.c: Chain up in buildable_finish()
* gtk/gtkbuilder.c: _gtk_builder_get_absolute_filename() handle
cases where g_path_get_dirname() returns "."
* docs/reference/gtk/tmpl/gtklabel.sgml,
docs/reference/gtk/tmpl/gtkbuilder.sgml: Added documentation
for the <attributes> tags on GtkLabel
svn path=/trunk/; revision=20008
2008-03-20 Tor Lillqvist <tml@novell.com>
Bug 314084 - GTK+ dialogs should not be placed partially offscreen
* gtk/gtkwindow.c (clamp): New function. Clamps a window position
in one dimension, or centered in case it doesn't fit.
(clamp_window_to_rectangle): Simplify. Call clamp() for x and y
dimensions.
svn path=/trunk/; revision=19907
2008-02-12 Matthias Clasen <mclasen@redhat.com>
* gtk/*.c: Unify the handling of various "Enter" keysyms
all over the place. (#515047, Christian Persch)
svn path=/trunk/; revision=19528
2008-02-12 Michael Natterer <mitch@imendio.com>
* gtk/gtkwindow.c (gtk_window_activate_key): simply use
gtk_window_get_key_hash() to get the hash instead of manually
fiddling with quarks and gtk_window_keys_changed(). Also add
g_return_if_fail() to this public function.
svn path=/trunk/; revision=19521
2007-09-12 Kristian Rietveld <kris@imendio.com>
Fixes#426246.
* gdk/gdk.symbols:
* gdk/gdkwindow.[ch]
(gdk_window_freeze_toplevel_updates_libgtk_only),
(gdk_window_thaw_toplevel_updates_libgtk_only): new functions
to freeze a toplevel window and all its descendants. To be made
public in 2.14,
(gdk_window_schedule_update): return if toplevel is frozen,
(gdk_window_process_all_updates): defer processing updates if toplevel
is frozen.
* gtk/gtkwindow.c (gtk_window_configure_event): directly size
allocate for override redirect windows, freeze toplevel and
descendants otherwise and wait until resizing is done.
svn path=/trunk/; revision=18802
2007-08-23 Cody Russell <bratsche@gnome.org>
* gtk/gtkwindow.c (gtk_window_group_remove_window: Use the
correct type check on `window'. We now check GTK_IS_WINDOW
rather than GTK_IS_WIDGET. (#461483, Josselin Mouette)
svn path=/trunk/; revision=18681
2007-06-04 Michael Natterer <mitch@imendio.com>
Move "move-focus" signals from several widgets to GtkWidget to
enable more flexible costomization of keyboard navigation via
bindings. Fixes bug #414947.
* gtk/gtkwidget.c: add "move-focus" binding signal, default to
calling the toplevel GtkWindow's "move-focus" vfunc.
* gtk/gtktextview.[ch]
* gtk/gtkwindow.[ch]: remove "move-focus" signals and add compat
code that makes sure that both emitting the signal on the widget
and overriding the virtual functions keeps working as before.
* gtk/gtktoolbar.c: remove "move-focus" signal here too and use
GtkWidget's signal. This change slightly changes keyboard
navigation in toolbars. I'll fix the behavior if somebody can
explain me if and how exactly the new behavior is broken.
svn path=/trunk/; revision=18025
2007-04-30 Tor Lillqvist <tml@novell.com>
Add functionality to set overall opacity of a top-level
window. (#405316)
* gtk/gtk.symbols: Add gtk_window_set_opacity and
gtk_window_get_opacity.
* gtk/gtkwindow.c (struct _GtkWindowPrivate,
(gtk_window_class_init): Add opacity property, a double in the
range [0, 1].
(gtk_window_set_opacity, gtk_window_get_opacity): Implement.
(gtk_window_realize): If opacity is set, call
gdk_window_set_opacity().
* gtk/gtkwindow.h: Declare gtk_window_set_opacity() and
gtk_window_get_opacity().
svn path=/trunk/; revision=17731
2007-03-13 Emmanuele Bassi <ebassi@gnome.org>
Apply patch by Vytautas Liuolia for changing the startup
notification id on a window in the X11 backend. (#347375)
* gdk/gdk.h:
* gdk/gdkx.h:
* gdk/x11/gdkdisplay-x11.c: Add gdk_notify_startup_complete_wit_id()
and gdk_x11_display_get_startup_notification_id().
* gdk/gdkwindow.h:
* gdk/x11/gdkwindow-x11.c: Add gdk_window_set_startup_id().
* gtk/gtkwindow.h:
* gtk/gtkwindow.c: Add gtk_window_set_startup_id(), used to
change the startup notification id.
(gtk_window_class_init), (gtk_window_init),
(gtk_window_set_property): Add write-only "startup-id" property
to GtkWindow.
(gtk_window_realize): Set the startup notification id
on a GtkWindow if it's valid.
(gtk_window_map): If we have another valid startup notification
id then finish the notification process.
svn path=/trunk/; revision=17508
2007-02-05 Michael Natterer <mitch@imendio.com>
* gtk/gtksettings.c: add new boolean settings gtk-enable-accels
and gtk-enable-mnemonics which enable/disable accelerators and
mnemonics (bug #72375, based on a patch from Tommi Komulainen).
* gtk/gtkwindow.c (gtk_window_activate_key)
* gtk/gtkmenushell.c (gtk_menu_shell_key_press): don't invoke them
if the resp. setting is FALSE.
* gtk/gtkaccellabel.c (gtk_accel_label_refetch)
* gtk/gtklabel.c (gtk_label_set_pattern_internal): don't display
them if the setting is FALSE.
* gtk/gtklabel.c: added signal connection to the screen's settings
object and traverse all widgets on the screen when the setting
changes. It's slightly ugly to also update GtkAccelLabels here,
but less ugly than connecting and traversing all widgets twice.
svn path=/trunk/; revision=17262
2007-01-05 Michael Natterer <mitch@imendio.com>
* gtk/gtkwindow.c (gtk_window_key_release_event): chain up to
the right function (fix taken from maemo-gtk).
svn path=/trunk/; revision=17078
2007-01-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Only process
updates on the window at hand, not on all windows, to
avoid violating resize/redraw ordering constraints.
(#362406, Owen Taylor)
svn path=/trunk/; revision=17028