Commit Graph

2953 Commits

Author SHA1 Message Date
Matthias Clasen
be83e8789c Tiny docs improvement
Mention that gdk_xid_table_lookup may return  NULL. Bug 591432.
2009-08-17 13:46:30 -04:00
Alexander Larsson
f7185ec704 Don't crash on NULL parent
The parent window can be NULL, check for that before dereferencing.
2009-08-17 16:59:47 +02:00
Alexander Larsson
44b84fe12d Remove unused variable 2009-08-16 22:32:58 +02:00
Alexander Larsson
528546733f Fix gdk_window_get_geometry for native children with non-native parent
gdk_window_get_geometry calls the native function for all non-native
windows. This returns coords relative to the native parent. We need
to convert this to be relative to the client side parent.

This fixes DnD coordinates in firefox (bug 588437).
2009-08-16 22:27:19 +02:00
Alexander Larsson
bd0755753a Always queue antiexposes after flushing outstanding moves
If antiexposures are queued and then we do the outstanding moves
we will queue translations that will affect incomming exposes
wrongly wrt the antiexposure. So, make sure we process the outstanding
moves before doing the antiexposure.

Additionally this commit adds a bunch of comments about how the
expose handling works and fixes a small bug that made us always
flush outstanding moves a little to early than necessary.
2009-08-14 12:09:02 +02:00
Alexander Larsson
f1f7df6443 Fix type mismatch warnings
Cast g_list_foreach args to GFunc.
2009-08-14 11:20:12 +02:00
Tor Lillqvist
341b8a4752 Initialize missing methods on Windows
Set the input_window_destroy and input_window_crossing methods of the
GdkWindowImplIface on Windows. Add implementation of
_gdk_input_crossing_event that is mostly dummy, though.
2009-08-13 22:49:35 +03:00
Alexander Larsson
9f82243197 Make _gdk_window_process_updates_recurse reentrancy safe
Apps may change the window hierarchy while recursing over it by
destroying windows from the expose event handler. We need to copy
the children list and ref all the children while recursing.

This fixes some crashers in gedit (bug #589367, bug #591434)
2009-08-13 17:00:00 +02:00
Alexander Larsson
7667c4d8dc Fix leaks of clip region and outstanding moves
We're never freeing these, do so when destroying.
Fixes bug 589877
2009-08-13 16:49:58 +02:00
Alexander Larsson
939e55223c Ensure that queue_translation is paired with the right X operation
The X11 queue_translation operation uses NextRequest to get the serial
of the XCopyArea operation where the translation should end. However,
if the gc passed to gdk_draw_drawable has a non-flushed clip region
(which it commonly has now for the window clipping) then the next
operation will be the GC flush, not the XCopyArea.

To handle this right we now pass in the GC to be used to
queue_translation and ensure that it is flushed before calling
NextRequest().
2009-08-13 14:46:02 +02:00
Alexander Larsson
e25ac0b5cb Clarify comment 2009-08-13 14:46:01 +02:00
Alexander Larsson
043ca236f2 Invalidate old source in gdk_window_move_region
When we copy the region we need to also re-expose the areas of
the copied region that was not also in the destination.
And, we need to do this invalidation after the move, as the
move also moves any invalid area.
2009-08-13 14:46:01 +02:00
Alexander Larsson
8a517dc0bb Modify window system exposes wrt outstanding moves
If there are outstanding moves in an area that intersects
the source of an outstanding move we need to move the invalid
area correspondingly, otherwise we will expose the wrong area
as the outstanding move copy will happen before we expose
the invalid area.
2009-08-13 14:46:01 +02:00
Alexander Larsson
a3ee8271a9 Check for GraphicsExpose too in expose_serial_predicate
GraphicsExpose cause invalidation too, so we need to look for such
events in addition to normal Expose events.
2009-08-13 14:46:01 +02:00
Alexander Larsson
f019047402 Don't un-invalidate area that will be immediately invalidated again.
When moving an area we move any invalid region in this area to the
new place, but there really is no need to remove the old invalid
area as it would just be invalidated again (being newly exposed).
2009-08-13 14:46:01 +02:00
Alexander Larsson
ff558e2ec6 Remove C++ comment 2009-08-13 14:46:01 +02:00
Matthias Clasen
bdffae7f6c Make setting the root cursor work again
This used to work, and CSW broke it. Bug 591462, 589844.
2009-08-11 14:19:35 -04:00
Alexander Larsson
fa21459066 Fix clearing of window background for some transparent notification icons
This extends the usage of the native clear region call such that its
called also for windows that have parent relative background all the
way up to a native window. That way we get true background relative
background clearing even to a foreign parent, which means that some
transparent notification icons look right again.
2009-08-11 15:41:23 +02:00
Alexander Larsson
60fa0da96d Implement fallback for old draw_drawable vfunc
GdkDrawable->draw_drawback was replaced with a new vfunc
draw_drawback_with_src that is now called from gdk_draw_drawable.
However, some code seems to call the vfunc directly (see bug #591288),
so make it chain to the new call.

Note that such direct vfunc calls are a bad idea and won't work for all
cases.
2009-08-11 12:58:48 +02:00
Alexander Larsson
f30cfd729a Show/Hide native window when updating viewable
This moves the native show/hide calls to the generic code
for calculating viewable rather than in its own separate code
called from gdk_window_show/hide. This simplifies the code a bit,
but most significantly it means things are correctly shown when
they become viewable for other reasons than a show/hide call.

For instance, this fixes bug 590442 (gvim embedding) where the
toplevel GtkPlug is mapped by the embedder and we didn't previously
pick up that the native children became viewable and should be shown.
2009-08-11 11:35:35 +02:00
Alexander Larsson
19c1c11322 Don't invalidate unnecessary areas on raise
We used to invalidate the whole window when raised, but this is
unnecessary much, we now just invalidate the visible area minus the
previously visible area.

This also fixes a problem where expose calling raise caused a loop (#588438)
2009-08-10 15:35:33 +02:00
Alexander Larsson
0fc8c475a8 Remove old comment about guffaw scrolling
We no longer use guffaw scrolling since the client side windows
branch was merged.
2009-08-10 14:27:53 +02:00
Alexander Larsson
7f92684237 Don't ever invalidate the root window
This never worked before csw since the root window is never
set as IS_MAPPED, but with the new viewable check (which is
true for the root window) we could erronously queue exposes
on the root window.

This happened unexpectedly in bug 589369, where metacity
got a GraphicsExpose event on the root window due to some
graphics operation, queueing an expose which would be handled
by clearing that area. That is fixed with this commit.
2009-08-10 14:13:06 +02:00
Javier Jardón
ec7c24d227 Remove some unused variables (GnomeBug:591218) 2009-08-10 11:06:54 +02:00
Matthias Clasen
69fc109c22 Avoid some gratitious behaviour changes
Go back to allowing a lot of the WM-level functions on foreign windows,
since we used to allow that before csw. Fixes bug 589732.
2009-08-08 22:00:07 -04:00
Matthias Clasen
b514c6ac22 Fix a logic error in gdk_window_set_title on OS X
Also fix a similar error in gdk_window_set_transient_for.
This fixes bug 589738
2009-08-07 00:13:44 -04:00
Matthias Clasen
5002976fab Fix a logic error in gdk_window_set_title on OS X
This fixes bug 589738
2009-08-07 00:10:43 -04:00
Kristian Rietveld
8c8e1daefa Add stubs for missing GDK windowing functions to Quartz backend
This seems to more or less fix the build.  On Tiger there are still issues
with libresolv missing on the link line, I will figure out what's up with
that soonish.
2009-07-31 21:22:54 +02:00
Emmanuele Bassi
6f0f5f8dc7 Fix gdk_window_get_cursor() documentation
The 'Return value' annotation is missing from the documentation
of gdk_window_get_cursor().
2009-07-30 11:12:27 +01:00
Emmanuele Bassi
1811ecfb58 Add missing gdk_window_get_cursor to the GDK symbols 2009-07-30 11:12:26 +01:00
Cody Russell
1780361b79 add gdk_window_get_cursor() 2009-07-29 22:38:36 -05:00
Cody Russell
313b6f39a6 _gdk_window_impl_new() on directfb 2009-07-27 15:39:28 -05:00
Hans Breuer
a7394dc887 Implement GdkDrawableImplWin32::draw_pixbuf 2009-07-26 19:14:08 +02:00
Hans Breuer
45344cdf7c Use G_DEFINE_TYPE (GdkDrawableImplWin32, ...) 2009-07-26 19:14:07 +02:00
Hans Breuer
c5c87a918f Some cursor work for csw(win32), more left to do 2009-07-26 19:14:06 +02:00
Hans Breuer
4d2c165b75 Formatting and removing commented/obsolete code 2009-07-26 19:14:04 +02:00
Alexander Larsson
a504784b4b Fix cairo rendering on large subwindows
We get the real pixmap size and use as cairo surface size rather
than doing some magic to try to get clipping on the right hand size
(and the magic looks wrong anyway).

The previous code could result in the width/height being to big for
the cairo 28.4 fix point size and thus not drawing anything.

This fixes bug #588076.
2009-07-24 21:44:57 +02:00
Alexander Larsson
9d69355e6f Fix clipping of pixbuf drawing to windows
When the fallback for gdk_draw_pixbuf (gdk_drawable_real_draw_pixbuf)
is called with a window destination we have already applied any clip
regions and offsets for the window, but the window we get is a wrapper
and not an impl. We have to ensure we really draw to the impl, as
otherwise the pixbuf drawing will be clipped by client side subwindows.

This fixes bug 588553.
2009-07-23 22:03:15 +02:00
Alexander Larsson
e71c5d3ab5 Avoid unnecessary indirect call
Call klass->draw_pixbuf directly inside gdk_window_draw_pixbuf
instead of gdk_draw_pixbuf to avoid doing all checks twice.
2009-07-23 22:03:15 +02:00
Cody Russell
d84b575cd0 Bug 589275 – [csw] Trying to destroy NULL regions
gdk_window_input_shape_combine_mask() can accept NULL for the mask
parameter, but it wasn't checking for NULL before passing the
resulting GdkRegion to gdk_region_destroy().  Fixes #589275
2009-07-21 11:44:25 -05:00
Alexander Larsson
18048308e4 Revert all handling of clip_region being unset for non-viewable windows
This is now handled by explicitly setting it to empty for all non-viewable
windows.

This reverts these commits:
82e609c2a0
36861cf608
454160ad9e
7adf894a29
ed2c837574
2009-07-20 23:26:02 +02:00
Alexander Larsson
3c03683e09 Set clip region to empty for non-viewable windows
This lets us avoid lots of viewable checks and still not waste
time computing clip regions for non-viewable windows
2009-07-20 23:15:34 +02:00
Alexander Larsson
82e609c2a0 Make gdk_window_begin/end_paint handle non-viewable windows
These are updated to not read clip region is not viewable
2009-07-20 22:36:02 +02:00
Alexander Larsson
36861cf608 Make gdk_drawable_get_visible/clip_region handle the !viewable case
We can't access ->clip_region for these cases as its not yet calculated.
2009-07-20 22:30:48 +02:00
Alexander Larsson
bf78db5690 Calculate clip region when window goes viewable
Since we're no longer calculating clip regions for non-viewable windows
we need to calculate it when it goes viewable.
2009-07-20 22:19:35 +02:00
Matthias Clasen
8430e215a7 Remove a duplicate include.
This was pointed out in bug 588897.
2009-07-20 00:31:20 -04:00
Alexander Larsson
aa47fca68f Exit remove_child_area when region is empty
When the region is empty we can return early, because there
is no more area to remove. This happens often for children
of scrolled windows (i.e. things that are clipped out.
2009-07-19 22:38:06 +02:00
Alexander Larsson
a057c03889 Optimize remove_child_area for children outside region
If a child is totally outside the current region, bail early instead
of doing costly calculations to subtract the child region.
2009-07-19 22:38:06 +02:00
Alexander Larsson
454160ad9e Fix read of non-initialized clip_region
Foreign children are always viewable but may not have a viewable
parent, so ensure we don't read the parent for them.
2009-07-18 23:15:57 +02:00
Alexander Larsson
7adf894a29 Don't read non-initialized clip region
The clip region is only initialized (and needed) for viewable windows.
2009-07-18 23:15:57 +02:00