Commit Graph

323 Commits

Author SHA1 Message Date
Alexander Larsson
6a0d317866 Keep track of the impl windows wrapper directly with a ref
This is needed so that the ->wrapper of the impl window doesn't
go away while there are virtual windows referencing the impl
window.
2009-04-02 10:15:26 +02:00
Alexander Larsson
7da48afcaa Don't allow native window > 65535 pixels 2009-04-02 10:15:25 +02:00
Alexander Larsson
5fa1855a83 Make _gdk_x11_window_tmp_unset_parent_bg not change above the toplevel window 2009-04-02 10:15:20 +02:00
Alexander Larsson
ed9cd90b72 Fix various problem with temporarily unsetting background
All the calls that unset private->parent failed if that was
not a native window (impl), instead we need to find the impl window
for the parent. Add some helper functions for this and use them.

For move/resize of child windows, we really need to recursively unset
on the parent, because moving the window could expose other native
children of the parent.

In do_shape_combine_region, only unset background if we're changing
the bounding shape (i.e. not the input shape)
2009-04-02 10:15:20 +02:00
Alexander Larsson
c31ef39d76 Don't flicker when unsetting shape (using bg none) 2009-04-02 10:15:20 +02:00
Alexander Larsson
377ca19c9f Add restack_under method to GdkWindomImpl 2009-04-02 10:15:19 +02:00
Alexander Larsson
d6ecaca166 Handle GDK_WA_CURSOR in non-native window creation 2009-04-02 10:15:18 +02:00
Alexander Larsson
4d187531e4 Set bg none while changing so we don't draw the bg color 2009-04-02 10:15:18 +02:00
Alexander Larsson
e63de13f40 Correct type checks on gdk_window_set_group entry. 2009-04-02 10:15:18 +02:00
Alexander Larsson
26569bd54f Avoid flickering by using more temp unset bg 2009-04-02 10:15:17 +02:00
Alexander Larsson
4202cc0c60 Fix gdk_window_get_root_origin and gdk_window_get_frame_extents when called on non-toplevels 2009-04-02 10:15:17 +02:00
Alexander Larsson
4a0cb4a240 Various fixes for native windows:
move_region_on_impl() - doesn't need to copy anything if dx/dy == 0
Ensure that we queue an update when invalidating an empty area but we have outstanding moves
Temporarily unset background when moving native child windows
2009-04-02 10:15:17 +02:00
Alexander Larsson
f6e1b0ac17 Ensure that we're properly hiding impl window if one of its parent non-impl windows are hidden
Also, add some debug printing code to list the GdkWindow tree
2009-04-02 10:15:16 +02:00
Alexander Larsson
d7e369c27a Implement input shapes 2009-04-02 10:15:16 +02:00
Alexander Larsson
e14e05addc Remove shape_combine_mask from backend. Make X11 backend use XShapeCombineMask directly to unset region 2009-04-02 10:15:16 +02:00
Alexander Larsson
4ba2b181bf Implement shaped windows 2009-04-02 10:15:16 +02:00
Alexander Larsson
062da50b9f Add _gdk_windowing_window_get_shape 2009-04-02 10:15:16 +02:00
Alexander Larsson
0ba99e6e7b Make gdk_windowing_window_destroy a GdkWindowImpl method 2009-04-02 10:15:15 +02:00
Alexander Larsson
36ce54878b Make _gdk_windowing_window_queue_translation a GdkWindiwImpl call 2009-04-02 10:15:15 +02:00
Alexander Larsson
f22211c881 Remove unnecessary clear_area method in GdkWindowImpl 2009-04-02 10:15:15 +02:00
Alexander Larsson
b771c9924d New approach to motion event handling 2009-04-02 10:15:11 +02:00
Alexander Larsson
bb709321f0 Store colormap on impl window (necessary for e.g. foreign windows) 2009-04-02 10:14:07 +02:00
Alexander Larsson
ec5d176278 Move gdk_window_get_deskrelative_origin to the GdkWindowImpl and make the common code handle abs_x/y 2009-04-02 10:14:07 +02:00
Alexander Larsson
6b1d7fd53d Make synchronized_configure work for child windows (used by in-process plugs) and ensures a native window exist 2009-04-02 10:14:05 +02:00
Alexander Larsson
ec4f8baa08 For foreign parents, use the real parent not the root (which is what we list as parent in the APIs) 2009-04-02 10:14:05 +02:00
Alexander Larsson
eabac453e6 Initial client-side-windows work
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.
2009-04-02 10:14:01 +02:00
Matthias Clasen
1934d3423b Fix a typo
svn path=/trunk/; revision=21877
2008-12-13 05:20:10 +00:00
Matthias Clasen
8f59f3adbb Return FALSE from reparent implementations to avoid #548993. Patch by Ed
2008-08-27  Matthias Clasen  <mclasen@redhat.com>

        * gdk/x11/gdkwindow-x11.c:
        * gdk/win32/gdkwindow-win32.c: Return FALSE from reparent
        implementations to avoid #548993. Patch by Ed Catmur.


svn path=/trunk/; revision=21215
2008-08-28 00:32:17 +00:00
Michael Natterer
971023d922 Some unrelated cleanups found while reviewing the offscreen window patch:
2008-06-30  Michael Natterer  <mitch@imendio.com>

	Some unrelated cleanups found while reviewing
	the offscreen window patch:

	* gdk/gdkwindow.c: add missing Since: 2.14 to the redirection
	functions, fix some function header indentation, update
	documentation of redirect_to_drawable().

	* gdk/x11/gdkwindow-x11.c
	* gdk/x11/gdkpixmap-x11.c: fix function header
	formatting/indentation.

	* gtk/gtkwidget.c: use I_() on "damage_event".


svn path=/trunk/; revision=20708
2008-06-30 12:15:29 +00:00
Emmanuele Bassi
e27632cd6d Abstract some GdkWindow API into an interface that the backends must
2008-06-27  Emmanuele Bassi  <ebassi@gnome.org>

	Abstract some GdkWindow API into an interface that the backends
	must implement. (based on a patch by Alex Larsson)

	* gdk/Makefile.am: Add gdkwindowimpl.[ch]

	* gdk/gdk.symbols: Move symbols around.

	* gdk/gdkinternals.h:
	* gdk/gdkwindowimpl.[ch]: Move some of the GdkWindow API we require
	from the backends to a GInterface that the backends should implement
	instead.

	* gdk/gdkwindow.c: Provide some of the GdkWindow public API as a
	wrapper call around the GdkWindowImpl interface vtable.

	* gdk/x11/gdkevents-x11.c:
	* gdk/x11/gdkgeometry-x11.c:
	* gdk/x11/gdkprivate-x11.h:
	* gdk/x11/gdkwindow-x11.c:
	* gdk/x11/gdkwindow-x11.h: Update the X11 backend to implement
	the GdkWindowImpl interface.

svn path=/trunk/; revision=20695
2008-06-27 14:27:44 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Matthias Clasen
d06e3a6a62 Return the right coordinates
svn path=/trunk/; revision=20325
2008-06-06 20:57:50 +00:00
Cody Russell
4f84a5f292 Bug 526635 - _gdk_window_get_toplevel handles FOREIGN windows
2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 526635 - _gdk_window_get_toplevel handles FOREIGN windows

        * gdk/x11/gdkwindow-x11.c (_gdk_window_get_toplevel): Check
        !WINDOW_IS_TOPLEVEL instead of checking for GDK_WINDOW_CHILD,
        so that we also take into account for foreign windows.
        Report and patch by Nathaniel Smith.


svn path=/trunk/; revision=20166
2008-05-25 23:27:34 +00:00
Cody Russell
4a5da1a18d Bug 524110 - Gdk should not assume reparenting WMs when retrieving window
2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 524110 - Gdk should	not assume reparenting	WMs when retrieving
        window	frame extents

        * gdk/x11/gdkwindow-x11.c (gdk_window_get_frame_extents):
        Use _NET_FRAME_EXTENTS,	if available. Patch by Danny Baumann.


svn path=/trunk/; revision=20164
2008-05-25 23:14:39 +00:00
Cody Russell
030ff5b10a Bug 522269 - Evince windows sometimes incorrectly unmaximized, caused by
2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 522269 - Evince windows sometimes incorrectly unmaximized,
        caused by missing flag initialization

        * gdk/x11/gdkwindow-x11.c (set_initial_hints): Initialize
        top-level private flags correctly.  Patch by Danny Baumann.


svn path=/trunk/; revision=20163
2008-05-25 23:09:09 +00:00
10:49:20 Tim Janik
4111cf2065 Bug 318807 – Offscreen windows and window redirection.
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-05-21 19:04:24 +00:00
Michael Natterer
8243e3d415 gdk/gdkdisplay.h gdk/gdkdrawable.h gdk/gdkevents.h gdk/gdkpango.h
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
2008-01-15 15:32:37 +00:00
Michael Natterer
92f86e0496 gdk/gdk.h gdk/gdkcairo.h gdk/gdkcolor.h gdk/gdkgc.h gdk/gdkinternals.h
2008-01-14  Michael Natterer  <mitch@imendio.com>

	* gdk/gdk.h
	* gdk/gdkcairo.h
	* gdk/gdkcolor.h
	* gdk/gdkgc.h
	* gdk/gdkinternals.h
	* gdk/gdkregion.h
	* gdk/gdkwindow.h: made GdkRectangle*, GdkRegion* and GdkColor*
	parameters const.

	* gdk/gdkcairo.c
	* gdk/gdkgc.c
	* gdk/gdkwindow.c
	* gdk/gdkrectangle.c
	* gdk/gdkpolyreg-generic.c
	* gdk/gdkregion-generic.c
	* gdk/directfb/gdkcolor-directfb.c
	* gdk/directfb/gdkgc-directfb.c
	* gdk/directfb/gdkgeometry-directfb.c
	* gdk/directfb/gdkwindow-directfb.c
	* gdk/quartz/gdkcolor-quartz.c
	* gdk/quartz/gdkgc-quartz.c
	* gdk/quartz/gdkgeometry-quartz.c
	* gdk/quartz/gdkwindow-quartz.c
	* gdk/win32/gdkcolor-win32.c
	* gdk/win32/gdkgc-win32.c
	* gdk/win32/gdkgeometry-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.c
	* gdk/x11/gdkcolor-x11.c
	* gdk/x11/gdkgc-x11.c
	* gdk/x11/gdkgeometry-x11.c
	* gdk/x11/gdkmain-x11.c
	* gdk/x11/gdkprivate-x11.h
	* gdk/x11/gdkwindow-x11.c: changed accordingly.

	* gdk/gdkpolyreg-generic.c: uncruftify to have proper function
	headers.


svn path=/trunk/; revision=19365
2008-01-14 14:02:12 +00:00
Matthias Clasen
c30e1d8e00 Don't return NULL.
2007-12-28  Matthias Clasen  <mclasen@redhat.com>

        * gdk/x11/gdkwindow-x11.c (get_default_title): Don't return NULL.


svn path=/trunk/; revision=19274
2007-12-28 15:51:31 +00:00
Ryan Lortie
f0cfba930c add note that the semantics of this call, when mixed with the new
2007-07-20  Ryan Lortie  <desrt@desrt.ca>

        * gtk/gtkwidget.c (gtk_widget_is_composited): add note that the
        semantics of this call, when mixed with the new
        gdk_window_set_composited(), will change in the future.

        * gdk/x11/gdkevents-x11.c (gdk_event_translate): only grab Damage
        events that belong to us.


svn path=/trunk/; revision=18506
2007-07-19 23:50:39 +00:00
Ryan Lortie
e8e5af2d8c Connect the "destroy" signal so that the 'window' pointer is set back to
2007-06-29  Ryan Lortie  <desrt@desrt.ca>

        * tests/testgtk.c (create_composited_window): Connect the "destroy" 
        signal so that the 'window' pointer is set back to NULL (like for the 
        other examples).

        * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_finalize): Don't 
        destroy the Damage here.  By finalize() XDestroyWindow has already 
        been called (and took the Damage with it).

        Bug #452046.


svn path=/trunk/; revision=18290
2007-06-29 16:02:24 +00:00
Tor Lillqvist
c62db99be2 Fix embarrassing crash. (#444457, Torsten Schoenfeld)
2007-06-06  Tor Lillqvist  <tml@novell.com>

	* gdk/x11/gdkwindow-x11.c (gdk_window_set_opacity): Fix
	embarrassing crash. (#444457, Torsten Schoenfeld)


svn path=/trunk/; revision=18045
2007-06-06 00:03:25 +00:00
Matthias Clasen
885ba04648 Add support for composited child windows. (#412882, Ryan Lortie)
2007-06-01  Matthias Clasen  <mclasen@redhat.com>

        Add support for composited child windows.  (#412882, Ryan Lortie)

        * gdk/gdk.symbols:
        * gdk/gdkdisplay.h:
        * gdk/gdkinternals.h:
        * gdk/gdkwindow.[hc]: Add gdk_display_supports_composite() and
        gdk_window_set_composited().

        * gdk/x11/gdkevents-x11.c:
        * gdk/x11/gdkdisplay-x11.[hc]:
        * gdk/x11/gdkwindow-x11.[hc]: X11 implementation.

        * gdk/win32/gdkdisplay-win32.c:
        * gdk/win32/gdkwindow-win32.c: Dummy win32 implementration.

        * gdk/quartz/gdkdisplay-quartz.c:
        * gdk/quartz/gdkwindow-quartz.c: Dummy Quartz implementation.

        * gdk/directfb/gdkdisplay-directfb.c:
        * gdk/directfb/gdkwindow-directfb.c: Dummy DirectFB implementation.

        * tests/testgtk.c: Add a "composited window" test.


svn path=/trunk/; revision=18004
2007-06-01 12:16:12 +00:00
Matthias Clasen
b6d58ad642 Fix docs
svn path=/trunk/; revision=17939
2007-05-26 20:43:23 +00:00
Dan Winship
17274cbe88 Make sure the leader_window's WM_CLIENT_LEADER points to itself. #435028
* gdk/x11/gdkwindow-x11.c (setup_toplevel_window): Make sure the
	leader_window's WM_CLIENT_LEADER points to itself. #435028

svn path=/trunk/; revision=17762
2007-05-02 00:02:14 +00:00
Tor Lillqvist
b18f044270 Add functionality to set overall opacity of a top-level window. (#405316)
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-04-30 07:27:22 +00:00
Cody Russell
273c94e194 Win32 drop shadow goodness
svn path=/trunk/; revision=17643
2007-04-25 23:44:54 +00:00
Elijah Newren
9384ea655c Patch from Matthias to add support for the _NET_WM_USER_TIME_WINDOW EWMH
2007-03-31  Elijah Newren  <newren gmail com>

	* gdk/x11/gdkwindow-x11.c (setup_toplevel_window,
	  gdk_x11_window_set_user_time):
	Patch from Matthias to add support for the
	_NET_WM_USER_TIME_WINDOW EWMH protocol; see #354213.

	WARNING: This patch will make metacity <= 2.18.0 freeze on
	workspace switch.  This is due to a weird problem that should only
	affect window managers using gdk in-process for decoration drawing
	and which make an unsafe assumption relating to doing so (i.e. it
	should only affect metacity).  Upgrade your version of metacity if
	you hit this bug.

svn path=/trunk/; revision=17574
2007-04-01 03:38:34 +00:00
Emmanuele Bassi
87c28d778a Apply patch by Vytautas Liuolia for changing the startup notification id
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-03-13 17:03:54 +00:00
Matthias Clasen
82ce59cd0f Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09  Matthias Clasen <mclasen@redhat.com>

        * Everywhere: Remove unnecessary NULL checks before
        g_free().  (#369666, Morten Welinder, Djihed Afifi)

        * configure.in: Check for ftw.h



svn path=/trunk/; revision=17444
2007-03-09 21:57:37 +00:00