we now use gdk_offscreen_window_set_embedder() instead of a signal
to get the parent. This also replaces set_has_offscreen_changes.
Rename "parent" in all embedding related names to "embedder" to make it
more obviously different than the normal parent.
Rename gdk_window_get_offscreen_pixmap to gdk_offscreen_window_get_pixmap
to match the other offscreen calls.
Rename gdk_window_offscreen_children_changed to gdk_window_geometry_changed
as this is more descriptive.
You can call this if you have offscreen children and the geometry of
them changed. This will cause re-picking of the active window sending
enter and leave events as needed.
We want to be able to map any window coordinate to a root coordinate, not
just the origin, because you can't rely anymore on a simple translation
from window coordinates to parent with offscreen windows. This lets
us e.g. pop up menus in the right place even if they are popped up from
a no-window widget.
3 signals are for offscreen windows
get-offscreen-parent: Get the parent window an offscreen is embedded in
to-parent: Convert coordinates from offscreen to parent
from-parent: Convert coordinates from parent to offscreen
1 signal is for the window embedding offscreens:
pick-offscreen-child: This picks what (if any) offscreen is at a specific position
The last signal is only used if you call gdk_window_set_has_offscreen_children
to tell gdk that the window has embedded offscreen children.
Add get-pointer signal for offscreen window pointer getting
Apps using offscreen windows can connect to get-pointer on offscreen
windows in order to make gdk_window_get_pointer() return correct
values.
Add get-offscreen-parent signal
Add signals for from-parent and to-parent coordinate mapping
Add pick-offscreen-child signal
Unfortunately the old GdkWindowObject is public and accessed
from macros, etc. So, we publish a limited copy of GdkWindowObject
and use the full one internally when building gdk.
In the new world offscreen windows are not put in the hierarchy, but are
rather toplevels for themselves. Offscreen hooks don't make any sense
in this model.
The history before this was kind of twisted as several different
approaches were tested, so that was all squashed into this initial
commit to hide the uninteresting changes and files that were later
removed.
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
2008-05-28 Michael Natterer <mitch@imendio.com>
* gdk/gdk.h: define __GDK_H_INSIDE__ around including all other
headers.
* gdk/gdkenumtypes.h.template
* gdk/gdk*.h: add single-include guards that #error out if
GTK_DISABLE_SINGLE_INCLUDES is defined and any of these files is
included individually. Also removed some redundant includes and
did some tiny trailing whitespace removal that's not worth to
commit separately.
* gdk/gdkprivate.h: include <gdk/gdk.h> instead of individual
files.
* gdk/win32/gdkwin32.h
* gdk/x11/gdkx.h: only include <gdk/gdkprivate.h> and remove all
other includes.
svn path=/trunk/; revision=20217
2008-03-18 10:49:20 Tim Janik <timj@imendio.com>
* Applied pixmap redirection patch by Alexander Larsson with
various updates from:
Bug 318807 – Offscreen windows and window redirection.
Updates:
* updated docs to mention "Since 2.16".
* tests/testgtk.c: fixed snapshooting pixmap leak.
convert pixmap to pixbuf after snapshooting, to compensate for different
bit depths (occurs when snapshooting ARGB visuals and displaying the
pixmap in an RGB visual).
* gdk/gdkwindow.[hc]: made GdkWindowRedirect private.
* gdk/gdkwindow.c: removed damage idle handler, there's no aparent
need for it. enqueue damage notification as GDK_DAMAGE events
for each painting redirection at the start of the event queue.
consider windows with a redirection fully visible when invalidating,
and when updating from backing store. cleaned up stale variables.
* gdk/gdkevents.c: added _gdk_event_queue_prepend().
* gtk/gtkwidget.c: fixed coordinates for !NO_WINDOW widgets in
gtk_widget_get_snapshot; this fixes garbage snap offsets for gammacurve,
tree, drawingarea, text, handlebox, etc.
clip the redirected window hierarchy to window sizes, the visible
rectangles don't need to be taken into account here.
extended snapshooting docs to recommend gdk_pixbuf_get_from_drawable()
in case pixmap visuals could mismatch.
* gdk/x11/gdkwindow-x11.c: removed _gdk_windowing_window_get_visible_rect().
Base patch:
* tests/testgtk.c: add a "Snapshot" test to demonstrate snapshooting
of possibly obscured widgets into an offscreen pixmap.
* gtk/gtkwidget.[hc]: add GtkWidget::damage-event signal, add
gtk_widget_get_snapshot() to render a widget's contents to a GdkPixmap.
* gtk/gtkmain.c: dispatch GDK_DAMAGE events.
* gdk/gdkwindow.c: moved outer gdk_window_new() and gdk_window_reparent()
implementations here, adapted them to propagate redirects to child windows.
gdk_window_end_paint(): copy repainted window contents to redirection pixmap,
clipped to visible region. queue GDK_DAMAGE event delivery.
gdk_window_redirect_to_drawable(): install window painting redirection.
gdk_window_remove_redirection(): remove previously installed redirection.
* gdk/x11/gdkwindow-x11.c: added _gdk_windowing_window_get_visible_rect(),
renamed _gdk_window_new() and _gdk_window_reparent().
* gdk/gdkwindow.h: added GdkWindowRedirect* to GdkWindowObject, export
gdk_window_redirect_to_drawable() and gdk_window_remove_redirection().
* gdk/gdkevents.h: added GDK_DAMAGE event type.
* gdk/gdkevents.c: extract time and state from GDK_DAMAGE events.
* gdk/gdkinternals.h: added internal prototypes.
svn path=/trunk/; revision=20122
2008-01-15 Michael Natterer <mitch@imendio.com>
* gdk/gdkdisplay.h
* gdk/gdkdrawable.h
* gdk/gdkevents.h
* gdk/gdkpango.h
* gdk/gdkregion.h
* gdk/gdkrgb.h
* gdk/gdkwindow.h: made more struct pointer and array parameters
const. GDK should now be constified as far as possible without
breaking source compatibility. Includes some minor cleanup like
indentation and s/nfoo/n_foo/ (bug #508544).
* gdk/gdkdisplay.c
* gdk/gdkdraw.c
* gdk/gdkevents.c
* gdk/gdkpango.c
* gdk/gdkregion-generic.c
* gdk/gdkrgb.c
* gdk/directfb/gdkdisplay-directfb.c
* gdk/directfb/gdkwindow-directfb.c
* gdk/quartz/gdkdisplay-quartz.c
* gdk/quartz/gdkwindow-quartz.c
* gdk/win32/gdkdisplay-win32.c
* gdk/win32/gdkwindow-win32.c
* gdk/x11/gdkdisplay-x11.c
* gdk/x11/gdkwindow-x11.c: changed accordingly.
svn path=/trunk/; revision=19372
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-04-30 Tor Lillqvist <tml@novell.com>
Add functionality to set overall opacity of a top-level
window. (#405316)
* gdk/gdk.symbols: Add gdk_window_set_opacity.
* gdk/x11/gdkwindow-x11.c
* gdk/win32/gdkwindow-win32.c: Implement
gdk_window_set_opacity(). On X11 use the _NET_WM_WINDOW_OPACITY
property. On Win32 use SetLayeredWindowAttributes(LWA_ALPHA).
* gdk/gdkwindow.h: Declare gdk_window_set_opacity().
* gdk/x11/gdkscreen-x11.c (gdk_screen_get_rgba_colormap): Document
that this is not implemented in the Windows backend. Add reference
to gdk_window_set_opacity().
svn path=/trunk/; revision=17730
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
2006-08-29 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkwindow.h:
* gdk/gdk.symbols:
* gdk/directfb/gdkwindow-directfb.c (gdk_window_beep):
* gdk/win32/gdkwindow-win32.c (gdk_window_beep):
* gdk/quartz/gdkwindow-quartz.c (gdk_window_beep):
* gdk/x11/gdkwindow-x11.c (gdk_window_beep): Add a function
to beep on a window. For X11, implement this with
XkbBell. (#353455, Mariano Suárez-Alvarez)
Tue Apr 25 10:25:28 2006 Søren Sandmann <sandmann@redhat.com>
* tests/testgtk.c (create_alpha_window): Create 'composited' label.
* tests/testgtk.c (on_composited_changed): New function, change
the label to say whether the screen is composited or not.
* gtk/gtkwindow.c (gtk_window_on_composited_changed): When
composited status change, invalidate the window and propagate the signal;.
* gtk/gtkwindow.c (gtk_window_map): Set the appropriate type hint
if reset_type_hint is TRUE.
* gtk/gtkwindow.c (gtk_window_set_type_hint): If hint is one of
the old hints, store a shadow copy in the public window->type_hint
bitfield, otherwise set this field to normal. Set the private
field to the type hint.
* gtk/gtkwindow.c (gtk_window_init): Initialize priv->type_hint.
* gtk/gtkwindow.c (struct _GtkWindowPrivate): New field
"reset_type_hint" indicating whether the type hint needs to be
reset. New field type_hint containing a GdkWindowTypeHint.
* gtk/gtkwidget.c (propagate_composited_changed): New function to
propagate changes in composited status.
(gtk_widget_class_init): Add composited_changed signal.
* gtk/gtkwidget.h (struct _GtkWidgetClass): New signal composited-changed.
* gtk/gtkwidget.c (gtk_widget_is_composited): New function.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips): Set transient for.
* gtk/gtktooltips.c (gtk_tooltips_force_window): Set the type hint
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Compute whether
the item belongs to a menubar. Set the type_hint appropriately
depending on the outcome.
* gtk/gtkmenu.c (gtk_menu_position): Set the default type hint here.
* gtk/gtkmenu.c (gtk_menu_attach_to_widget): connect to hierarchy
changed on the attach widget.
* gtk/gtkmenu.c (attach_widget_hierarchy_changed): New function to
set the transient_for property for menus.
* gtk/gtkdnd.c (set_icon_stock_pixbuf): Set the appropriate type hint.
* gtk/gtkcombo.c (gtk_combo_popup_list): Make the popup window
transient for the toplevel.
* gtk/gtkcombobox.c (gtk_combo_box_set_popup_widget): Set
transient-for, for the popup window.
* gdk/x11/gdkwindow-x11.c (gdk_window_get_type_hint): Support for
new window types.
* gdk/x11/gdkwindow-x11.c (gdk_window_set_type_hint): Add support
for new window types.
* gdk/x11/gdkscreen-x11.c (_gdk_x11_screen_process_owner_change):
New function called whenever the compositing manager comes and goes.
* gdk/x11/gdkscreen-x11.c (gdk_screen_is_composited): New function.
* gdk/x11/gdkscreen-x11.c
(_gdk_x11_screen_request_cm_notification, make_cm_atom,
check_is_composited): New functions
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Call
_gdk_x11_screen_process_owner_change when an
XFixesSelectionNotifyEvent is received.
* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Call
_gdk_x11_screen_request_cm_notification() on all screens.
* gdk/quartz/gdkscreen-quartz.c (gdk_screen_is_composited): Dummy
implementation.
* gdk/gdkscreen.c (gdk_screen_class_init): New signal,
'composited-changed'.
* gdk/gdkwindow.h: Add new EWMH window types.
* gdk/win32/gdkscreen-win32.c (gdk_screen_is_composited)
2006-02-19 Matthias Clasen <mclasen@redhat.com>
Support input shapes: (#331070)
* gdk/gdk.symbols:
* gdk/gdkdisplay.h:
* gdk/gdkwindow.h:
* gdk/x11/gdkdisplay-x11.c (gdk_display_supports_shapes)
(gdk_display_supports_input_shapes): Functions to determine
if a display supports shaped windows or input shapes.
* gdk/x11/gdkwindow-x11.c (gdk_window_input_shape_combine_region):
(gdk_window_input_shape_combine_mask):
(gdk_window_set_child_input_shapes):
(gdk_window_merge_child_input_shapes): Input shape versions
of the window shape API.
* gtk/gtk.symbols:
* gtk/gtkwidget.h:
* gtk/gtkwidget.c (gtk_widget_input_shape_combine_mask):
New function to set an input shape on a widget.
2005-09-26 Matthias Clasen <mclasen@redhat.com>
Fix#316871, reported by Dan Winship:
* gdk/gdkwindow.h (struct _GdkWindowObject): Add a shaped flag.
* gdk/x11/gdkwindow-x11.c (gdk_window_shape_combine_mask)
(gdk_window_shape_combine_region): Set it here.
* gdk/gdkwindow.c (gdk_window_invalidate_maybe_recurse): Don't
remove the child area for shaped windows.
2005-06-21 Matthias Clasen <mclasen@redhat.com>
* gdk/gdk.symbols:
* gdk/gdkwindow.h:
* gdk/x11/gdkgeometry-x11.c (gdk_window_move_region): New
function which can be used to implement scrolling in
non-window widgets. (#135165, Søren Sandmann)
2005-06-17 Matthias Clasen <mclasen@redhat.com>
Support the ICCCM urgency hint. (#61858, Havoc Pennington)
* gtk/gtk.symbols:
* gtk/gtkwindow.[hc]: Add a GtkWindow::urgency-hint property
with getter and setter.
* gdk/gdk.symbols:
* gdk/gdkwindow.h:
* gdk/x11/gdkwindow-x11.c (gdk_window_set_urgency_hint):
Add a setter for the urgency hint.
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store
urgency hint here.
* gdk/x11/gdkwindow-x11.c (update_wm_hints): Set the urgency
hint in the WM_HINTS property when appropriate.
Sun Jul 11 15:24:03 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Bug 143330, support update counter spec.
* configure.in: Add check for the Sync extension
* gdk/gdkwindow.h: gdk_window_enable_synchronized_configure() and
gdk_window_configure_finished()
* gtk/gtkwindow.c (gtk_window_move_resize): Call gdk_window_finish_configure().
* gtk/gtkwindow.c (gtk_window_realize): Automatically enable
synchronized configures.
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Store current
and pending counter values.
* gdk/x11/gdkwindow-x11.c (gdk_window_configure_finished): New function.
* gdk/x11/gdkwindow-x11.c
(gdk_window_enable_synchronized_configure): New function.
* gdk/x11/gdkwindow-x11.c (gdk_toplevel_x11_free_contents):
Delete update counter.
* gdk/x11/gdkwindow-x11.c (set_wm_protocols): Advertise
_NET_WM_SYNC_REQUEST when Sync is available
* gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Handle
_NET_WM_SYNC_REQUEST messages
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Save counter
value for use by gdk_window_configure_finished() when receiving
ConfigureNotifies.
* gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add use_sync flag
* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Check if the XSync
extension is available
* gdk/x11/gdkdisplay-x11.c: Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER to list of supported atoms.
* gdk/linux-fb/gdkwindow-fb.c, gdk/win32/gdkwindow-win32.c: Add
stubs for enable_synchronized_configure() and configure_finished()
2004-05-05 Elijah Newren <newren@math.utah.edu>
Changes to support do-not-focus-on-map hint in conjunction with
_NET_WM_USER_TIME (#115650):
* gdk/gdkwindow.h (struct _GdkWindowObject): Add a new boolean
field focus_on_map
* gdk/gdkwindow.h (gdk_window_set_accept_focus): New function to
set it.
* gtk/gtkwindow.[hc]: Add a boolean property "focus_on_map"
and gtk_window_get_focus_on_map() and gtk_window_set_focus_on_map().
* gdk/win32/gdkwindow-win32.c (gdk_window_new):
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
* gdk/x11/gdkwindow-x11.c (gdk_window_new):
Initialize the focus_on_map field to TRUE.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_focus_on_map):
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_focus_on_map):
* gdk/x11/gdkwindow-x11.c (gdk_window_set_focus_on_map):
* gdk/x11/gdkwindow-x11.c (setup_toplevel_window):
Implementations for the various backends. The Win32 and linux-fb
implementations set the focus_on_map field, but don't use it yet
to actually implement noinput windows. The X implementation sets
_NET_WM_USER_TIME to 0 if focus_on_map is FALSE (see the EWMH).
* gdk/x11/gdkwindow-x11.h:
* gdk/x11/gdkevents-x11.c (set_user_time):
* gdk/x11/gdkinput-x11.c (_gdk_input_common_other_event):
* gdk/x11/gdkwindow-x11.c (gdk_x11_window_set_user_time):
s/_gdk_x11_window_set_user_time/gdk_x11_window_set_user_time/,
since we want that function to be part of the public API.
Thu Dec 11 00:35:12 2003 Matthias Clasen <maclas@gmx.de>
Changes to allow "no input" windows (#64613):
* gdk/gdkwindow.h (struct _GdkWindowObject): Add a new boolean
field accept_focus.
* gdk/gdkwindow.h (gdk_window_set_accept_focus): New function to
set it.
* gtk/gtkwindow.[hc]: Add a boolean property "accept_focus"
and gtk_window_get_focus() and gtk_window_set_focus().
* gdk/win32/gdkwindow-win32.c (gdk_window_new):
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_new):
* gdk/x11/gdkwindow-x11.c (gdk_window_set_new):
Initialize the accept_focus field to TRUE.
* gdk/win32/gdkwindow-win32.c (gdk_window_set_accept_focus):
* gdk/linux-fb/gdkwindow-fb.c (gdk_window_set_accept_focus):
* gdk/x11/gdkwindow-x11.c (gdk_window_set_accept_focus):
Implementations for the various backends. The Win32 and linux-fb
implementations set the accept_focus field, but don't use it yet
to actually implement noinput windows. The X implementation updates
the WM_HINTS to select the globally active input model (see the
ICCCM) if accept_focus is FALSE.
* gdk/x11/gdkevents-x11.c (gdk_wm_protocols_filter): Ignore the
WM_TAKE_FOCUS message if accept_focus is FALSE.
Wed Dec 10 00:06:24 2003 Matthias Clasen <maclas@gmx.de>
Improve the GDK API for dealing with group leaders (#119375):
* gdk/gdkwindow.h:
* gdk/x11/gdkwindow-x11.c (gdk_window_get_group): New function to
get the group leader of a toplevel window as a GdkWindow.
* gdk/gdkdisplay.h:
* gdk/x11/gdkdisplay-x11.c (gdk_display_get_default_group): New
function to get the default group leader as a GdkWindow.
* gdk/x11/gdkdisplay-x11.h (struct _GdkDisplayX11): Add a field for
the GdkWindow of the default group leader.
* gdk/x11/gdkdisplay-x11.c (gdk_display_open): Construct the GdkWindow
for the default group leader.