Commit Graph

937 Commits

Author SHA1 Message Date
Jasper St. Pierre
b59d2d1afa gdkwindow: Move a variable closer to where it's used
To make the code clearer.
2014-06-22 10:20:50 -04:00
Jasper St. Pierre
b2be9c0a9b gdkwindow: Remove an unused variable 2014-06-22 10:20:49 -04:00
Jasper St. Pierre
0dfd506b3c gdkwidow: Make queue_antiexpose optional 2014-06-21 18:45:41 -04:00
Jasper St. Pierre
c767d504c5 gdkwindow: Don't bother with a return parameter for queue_antiexpose
Standard refcounting works perfectly well. Don't give us the opportunity
for more memory leaks.
2014-06-21 18:45:39 -04:00
Jasper St. Pierre
9036ed0d67 gdkwindow: Correct a signature
We removed the parameter from callers and from the implementation, but
not from the signature up top. I didn't notice because the branch I was
working on removed the signature entirely.
2014-06-21 11:25:40 -04:00
Jasper St. Pierre
47d6677e92 gdkwindow: Remove an extra region copy
This code is only called with the current paint region as its argument.
Instead of having to copy it and do a no-op intersect against itself,
just use the current paint directly.
2014-06-21 11:00:24 -04:00
Jasper St. Pierre
7fefd211b8 gdkwindow: Clean up code
Introduce a temporary to make the code a bit more clear under these cases.
2014-06-21 10:17:23 -04:00
Jasper St. Pierre
e700305279 gdkwindow: Clean up formatting
Tabs to spaces, add some whitespace.
2014-06-21 10:17:06 -04:00
Jasper St. Pierre
ec5e913a9b gdkwindow: Add some extra documentation to gdk_cairo_create
Mention the need to wrap the function inside
gdk_window_begin_paint_region and gdk_window_end_paint.
2014-06-21 10:01:33 -04:00
Jasper St. Pierre
60d39e973a gdkwindow: Squash a leak in the subsurface case
cairo_surface_create_for_rectangle takes a ref on the parent surface,
so we need to drop ours.

Rename get_window_surface to ref_window_surface to make the code more
clear and to stop this error from happening again.
2014-06-20 20:48:21 -04:00
Jasper St. Pierre
d619a78aeb gdkwindow: Don't create a subsurface if we don't need to
In the case we have a native window, we don't need to crop it to a
non-native subrectangle, as abs_x / abs_y / width / height are all 0.
2014-06-20 20:46:49 -04:00
Jasper St. Pierre
be30e440c3 gdkwindow: Remove the ability to call begin_paint_region more than once
Previously, each begin_paint_region added to a stack of current paints,
and when end_paint was called, the paint was popped off of the stack and
the surface was composited into the parent paint surface.

However, the code was broken in the case of a backend like Wayland which
didn't keep track of nested calls and simply wiped and returned the
native impl backing surface every time.

Since this feature is flat out unused by GTK+ and we don't want to
really support tricksy things like these for other clients, just remove
the feature. If somebody does call begin_paint_region more than once,
warn and return without doing anything.
2014-06-20 20:41:55 -04:00
Jasper St. Pierre
d48adf9cee gdkwindow: Remove the internal cairo_surface used for out-of-band painting
Traditionally, the way painting was done in GTK+ was with the
"expose-event" handler, where you'd use GDK methods to do drawing on
your surface. In GTK+ 2.24, we added cairo support with gdk_cairo_create,
so you could paint your graphics with cairo.

Since then, we've added client-side windows, double buffering, the paint
clock, and various other enhancements, and the modern way to do drawing
is to connect to the "draw" signal on GtkWidget, which hands you a
cairo_t. To do double-buffering, the cairo_t we hand you is actually on
a secret surface, not the actual backing store of the window, and when
the draw handler completes we blit it into the main backing store
atomically.

The code to do this is with the APIs gdk_window_begin_paint_region,
which creates the temporary surface, and gdk_window_end_paint which
blits it back into the backing store. GTK+'s implementation of the
"draw" signal uses these APIs.

We've always sort-of supported people calling gdk_cairo_create
"outside" of a begin_paint / end_paint like old times, but then you're
not getting the benefit of double-buffering, and it's harder for GDK to
optimize.

Additionally, newer backends like Mir and Wayland can't actually support
this model, since they're based on double-buffering and swapping buffers
at various points in time. If we hand you a random cairo_t, we have no
idea when is a good time to swap.

Remove support for this.

This is technically a GDK API break: a warning is added in cases where
gdk_cairo_create is called outside of a paint cycle, and the returned
surface is a dummy that won't ever be composited back onto the main
surface. Testing with complex applications like Ardour didn't produce
any warnings.
2014-06-20 20:41:54 -04:00
Jasper St. Pierre
b875572f2a gtkwidget: Widgets are now always double-buffered
gtk_widget_set_double_buffered is now deprecated, and we don't support
non-double-buffered widgets. This means that under normal circumstances,
paints are never outside of a begin_paint / end_paint sequence, which
natively-double-buffered backends like Wayland can't possibly support.
2014-06-20 20:41:54 -04:00
Jasper St. Pierre
a85f7028d4 gdkwindow: Deprecate gdk_window_flush
The function does nothing.
2014-06-20 20:41:53 -04:00
Matthias Clasen
5334fb8921 Drop GDK_MULTIHEAD_SAFE
We don't support multiple screens anymore, so there is no need
for marking API as multihead safe any longer.
2014-06-11 21:55:15 -04:00
Carlos Garnacho
a6526eb820 gdk: Lookup both device and global cursor when checking up the hierarchy
When the pointer cursor is updated on CSW, lookup for either a device
cursor, or a global one. It would previously lookup for windows with
a global cursor, and then check if it had a device cursor, which would
skip windows with only device cursors set, and unexpectedly set the
global cursor.
2014-05-23 19:54:31 +02:00
Matthias Clasen
3d2dcc2bfe Small typo fixes
We generally talk about the 'windowing system' in the GDK frontend
docs, not the 'window manager'.
2014-05-21 19:01:37 -04:00
Jasper St. Pierre
0ea1a526f9 gtkwindow: Use window-manager-side window menus
This avoids a bunch of policy problems with deciding how to lay
out the window menu under different WMs.

For now, we use the special event _GTK_SHOW_WINDOW_MENU, but we
hope to have this standardized in wm-spec quite soon, as KDE wants
it as well.
2014-05-21 18:41:07 -04:00
Evan Nemerson
701adf81b6 gdk: assorted introspection and documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=729983
2014-05-19 11:47:59 -07:00
Evan Nemerson
38d2458f53 gdk: add many missing (nullable) return value annotations
https://bugzilla.gnome.org/show_bug.cgi?id=729834
2014-05-11 11:48:32 -04:00
Carlos Garnacho
8e5982ca9d gdkwindow: ignore shape on client-side windows when recomputing visible regions
Rendering doesn't do much about clipping drawing operations to the window shape,
although invalidation applies the shape to every window, leaving possibly trails
of "overrendered" content. So ensure the shape portions get invalidated too when
the window is moved/resized.

https://bugzilla.gnome.org/show_bug.cgi?id=729095
2014-04-28 22:44:59 +02:00
Bastien Nocera
f71f7215ab all: Name more idles and timeouts
Following up from 438cd857c4,
name more timeouts and idles.

The original grep was missing checking for gdk_threads_add_*()
functions (at least for some of the files).

https://bugzilla.gnome.org/show_bug.cgi?id=726870
2014-03-26 20:09:30 -04:00
Jasper St. Pierre
efdd68b3b0 Implement get_root_origin generically for all backends
It seems that some backends implemented get_root_origin wrong
and returned the client window coordinates, not the frame window
coordinates. Since it's possible to implement generically for all
windows, let's do that instead of having a separate impl vfunc.
2014-03-17 15:51:46 -04:00
Benjamin Otte
e9aa5a9822 gdkwindow: Call function instead of copying its code
gdk_window_get_origin() is just a variant of
gdk_window_get_root_coords() after all.
2014-02-28 03:09:23 +01:00
Jasper St. Pierre
0f212b5fb7 gdkwindow: Always pass the impl window to GdkWindowImpl::get_root_coords
The point of GdkWindowImpl::get_root_coords is to translate the passed
in coordinates against the passed-in impl window. For a child window,
in fact, window->abs_x and window->abs_y already track the child
window's coordinates against the impl window.

If we pass in a child window, and backends don't explicitly get the impl
window from it, we'll double-count the child window.

Really, we should *always* be passing impl windows to backends, and
never child windows. However, I'm a bit worried for regressions late
in the cycle if we want to fix up the rest of the callers, like
gdk_window_get_geometry, so I'm only going to touch get_root_coords
for now after careful review of all the backends.
2014-02-27 21:06:35 -05:00
Giovanni Campagna
ad2f96ff48 Gdk: fix wrong user_data handling in resize_cairo_surface()
Instead of destroying the surface in the backend if this is
unable to resize, let the core code do it, and do it properly.

Based on a patch by Benjamin Otte.

https://bugzilla.gnome.org/show_bug.cgi?id=725172
2014-02-26 00:04:41 +01:00
Paolo Borelli
e34d9eafed Do not leak cairo_region 2014-02-21 21:11:21 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
d326507978 Revert "Use gdk_screen_get_preferred_visual()"
This reverts commit 30fa1426cf.

See the bugs
https://bugzilla.gnome.org/show_bug.cgi?id=724067
https://bugzilla.gnome.org/show_bug.cgi?id=723740
for the issues that are the reason for this revert.
2014-02-10 22:12:53 -05:00
William Jon McCann
a4b5929e81 docs: use apostrophe in *'re 2014-02-07 13:37:09 -05:00
William Jon McCann
285d216d3e docs: use apostrophe in *'ll 2014-02-07 13:35:54 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
47469eb296 Use proper quotes in gdk 2014-02-05 15:08:42 -05:00
William Jon McCann
c6ef8bdc9c docs: don't use <para id=""> 2014-02-04 20:21:05 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
76447c3512 docs: use quotes instead of <firstterm> 2014-02-04 18:10:11 -05:00
William Jon McCann
8d6717097c docs: Use markdown for ulinks 2014-02-04 16:58:53 -05:00
Matthias Clasen
30fa1426cf Use gdk_screen_get_preferred_visual()
When creating windows, and when returning a widgets
visual, use the new API to get the preferred visual.
2014-02-04 13:15:47 -05:00
Alexander Larsson
cc5752aff4 gdkwindow: Fix gdk_window_set_child_shapes()
This did the reverse of what it should, making the shape be
the part where the children were *not*.
2014-02-04 12:03:03 +01:00
Matthias Clasen
245c385ae7 Docs: Don't use note elements
In most cases, the text itself makes the message clear enough.
2014-02-02 01:22:14 -05:00
Matthias Clasen
09d1b28249 docs: Convert to markdown
Specifically, switch to using markdown syntax for sections.
2014-02-02 00:30:27 -05:00
William Jon McCann
2d003553e8 docs: don't use <emphasis>
It is a little heavy handed. The text can speak for itself.
2014-01-28 02:02:05 -05:00
William Jon McCann
916f1c0fd6 docs: fix style-updated link 2014-01-21 18:57:41 -05:00
William Jon McCann
4be68e518d docs: fix typos in class names 2014-01-20 18:27:29 -05:00
William Jon McCann
e1be5e2956 docs: fix typo in doc syntax 2014-01-20 18:27:29 -05:00
William Jon McCann
139b33aae5 docs: fix type in parameter type 2014-01-20 18:27:28 -05:00
William Jon McCann
201b093719 docs: remove link to missing example
Removed in e95490c15e etc.
2014-01-20 18:27:28 -05:00
Matthias Clasen
7125cdc5ff X11: Support keyboard-initiated move and resize operations
The EWMH defines _NET_WM_MOVERESIZE_SIZE_KEYBOARD and
_NET_WM_MOVERESIZE_MOVE_KEYBOARD for operations that are not
initiated by a button-press event. Allow using these by passing
a button of 0 to gdk_window_begin_move/resize_drag.
2014-01-12 22:25:19 -05:00
Matthias Clasen
8a42bb69aa Trivial typo fix 2014-01-04 14:11:55 -05:00
Marek Kasik
ccd6e1ba47 gdkwindow: Don't add the same window to "update_windows" twice
This prevents passing of such window to another GMainLoop.

https://bugzilla.gnome.org/show_bug.cgi?id=711552
2013-12-18 18:15:01 +01:00
Marek Kasik
1b032b18cc gdkwindow: Handle references in "update_windows" list correctly
Since update_windows list is a static variable in GdkWindow.c which
contains pointers to windows which needs to be updated, it can happen
that it contains a pointer to a window even after quit from a gtk_main().
If another gtk_main() is called in the same process it tries to process
windows in the list which leads to a crash.
Correct reference count handling of added windows prevents such applications
from crash.

https://bugzilla.gnome.org/show_bug.cgi?id=711552
2013-12-16 17:58:04 +01:00
Bastien Nocera
4b42526e1f gdkwindow: Use GdkWindowHints instead of guint for flags
https://bugzilla.gnome.org/show_bug.cgi?id=720342
2013-12-14 15:29:44 -05:00
Ryan Lortie
04897e5b09 gdk: add gdk_window_set_shadow_width()
And deprecate the X11-specific version of it.

We call this new API _set_shadow_width() and not _set_frame_extents()
because we already have a gdk_window_get_frame_extents() with a
different meaning and different type of value.

https://bugzilla.gnome.org/show_bug.cgi?id=720374
2013-12-12 23:53:47 -05:00
Philip Withnall
c73bdb21b4 gdkwindow: Remove an unused assignment
The show variable is assigned to in both branches of an if block a
little further down.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:51:07 +00:00
Philip Withnall
ad6f4926b6 gdkwindow: Remove an unused assignment
scale is only used if HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE is defined.

Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:51:07 +00:00
Philip Withnall
86b6170940 gdkwindow: Fix potential uses of uninitialised variables
Found with scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-11-24 21:20:44 +00:00
Owen W. Taylor
f50a3af1b7 Handle recursion from motion event handlers
If a motion event handler (or other handler running from the flush-events
phase of the frame clock) recursed the main loop then flushing wouldn't
complete until after the recursed main loop returned, and various aspects
of the state would get out of sync.

To fix this, change flushing of the event queue to simply mark events as
ready to flush, and let normal event delivery handle the rest.

https://bugzilla.gnome.org/show_bug.cgi?id=705176
2013-11-11 23:17:14 -05:00
Daniel Sabo
80dd1a851a Add an event_compression setting to GdkWindow
Setting event compression to false will allow inter-frame
mouse motion events to be delivered, which are necessary
for painting applications to produce smooth strokes.

https://bugzilla.gnome.org/show_bug.cgi?id=702392
2013-11-09 00:01:05 -05:00
Matthias Clasen
259c3c3699 Quell a compiler warning 2013-10-11 16:27:43 -04:00
John Ralls
cf66cf906e Ensure src and dest are GdkWindows in _gdk_sythesize_crossing_events
Discovered via a crash because b's (dest's) toplevel was NULL;
ensuring that the dest is actually a GdkWindow or setting b to NULL
prevents that path from being taken.
2013-10-11 10:54:15 -07:00
John Ralls
46838a2fe2 Suppress frequent device assertions
Because send crossing event is usually called with a NULL source_device in quartz.
2013-10-10 15:37:27 -07:00
Matthias Clasen
ca40ad1b1a Documentation fixes 2013-09-17 01:13:03 -04:00
Alexander Larsson
854f5818f8 Sync with changes in the cairo device-scale handling
The version of device scale that landed in upstream cairo
master already inherits the device scale in cairo_create_similar,
so no need to do that in gtk anymore.
2013-09-05 19:30:23 +02:00
Jasper St. Pierre
08fbba4558 gdk: Add opaque region setters
https://bugzilla.gnome.org/show_bug.cgi?id=706922
2013-08-28 10:33:57 -04:00
Juan Pablo Ugarte
497f25730d gdk_window_raise (): Do not invalidate toplevel windows. 2013-08-19 08:30:40 -03:00
Alexander Larsson
83c5e354bd wayland: Add custom create_similar_image implementation
The fallback method is used on other backends, but it caused
problems for wayland when it tried to create a surface for
the root window.
2013-07-03 16:03:25 +02:00
Alexander Larsson
e8b38fedbd gdk: Convert mouse position to doubles, add new getters
We've long had double precision mouse coordinates on wayland (e.g.
when rotating a window) but with the new scaling we even have it on
X (and, its also in Xinput2), so convert all the internal mouse/device
position getters to use doubles and add new accessors for the
public APIs that take doubles instead of ints.
2013-07-03 14:39:25 +02:00
Alexander Larsson
04f83a56a2 gdk: add gdk_window_create_similar_image_surface
This lets us create image surfaces that render faster on specific windows.
It also supports creating scaled image surfaces.
2013-07-03 14:34:13 +02:00
Alexander Larsson
56bec0c70c gdkwindow: Respect cairo surfaces with device scale
If a cairo_surface for a window has a device scale set we need
to respect this when creating a similar window. I.e. we want
to then automatically create a larger window which inherits
the scale from the original.

We also need to calculate a different device_offset if there
is a device_scale set.
2013-07-03 14:34:13 +02:00
Michael Natterer
8ad851f725 add gdk_screen_ and gdk_window_get_scale_factor()
These report the internal scaling factor, mapping from UI pixels
to hardware pixels.
2013-07-03 12:27:10 +02:00
Alexander Larsson
09a975a765 gdk: Fix shaped toplevels
We need to apply the shape for toplevels that have a shape.

https://bugzilla.gnome.org/show_bug.cgi?id=702831
2013-07-01 15:34:15 +02:00
John Lindgren
5fa0da4200 window: Make process_updates faster
Only look at "impl" windows in gdk_window_process_updates_with_mode()
since these are the only ones we care about.  This avoids a lot of
unnecessary calls to g_list_copy() and g_object_ref().
2013-06-26 10:03:51 +02:00
Alexander Larsson
c40155c8e6 gdkwindow: Don't recurse into clipped children when updating
We don't want to recurse into children that are clipped, as that is
wasted work. We handle this by moving the empty check to the top
of the function and only using the clipped region everywhere.
2013-06-25 10:07:49 +02:00
Matthias Clasen
5486bfb14f Minor documentation formatting fixes 2013-05-27 15:26:59 -04:00
Matthias Clasen
d824164e31 Add new symbols to docs
Also, minor formatting fixes.
2013-05-27 14:36:53 -04:00
Alexander Larsson
a60ccd3672 GdkWindow: Fix shape handling for native windows
We don't track the full clip for each window anymore, as this
is not useful when no windows are opaque. However, we still
need the full clip for the shape, so its calculated manually.

However, it was previously only recalculated when the clip changes
which doesn't correctly handle the case of a sibling geometry changing.

So, instead of doing this directly when geometry changes we just
set a bit in the toplevel whenever some window geometry changes, and
we then handle this in process_updates, updating the shape for all
native windows. This should be ok performance-wise because we don't
expect a lot of native children.
2013-05-15 11:08:35 +02:00
Alexander Larsson
85645e4852 GdkWindow: Fix debug function print_region 2013-05-15 11:08:35 +02:00
Alexander Larsson
8306d26714 GdkWindow: Track all native windows of native windows
We keep a list of all native children of a native window. This means
we don't have to recurse over the entire hierarchy to find any
native children.
2013-05-15 11:08:35 +02:00
Alexander Larsson
63a35b6f9c gdkwindow: Don't enforce a native window for a custom visual
In the ancient X days you could have Xservers that had multiple active windows, like
one truecolor and one 8bit palette. Then most apps ran in 8bpp but a single window
would use truecolor. This is done by specifying different visuals for the windows.

To make this work we ensured that a window with a visual different from its parent
gets a native subwindow, so that X can tell the hardware to do its magic.

These days the only real time we get two different visual is when one is a rgba visual
and the other is not. So, the code to check this doesn't really do anything but
get in the way when someone accidentally manages to not get a rgba visual on
a child window (see bb7054b508). So, to avoid
such errors we just remove the "different visual than parent" check.
2013-05-08 15:57:58 +02:00
Alexander Larsson
e90fab2b83 gdkwindow: Expose all native windows
We need to send exposes for all native windows, even the ones
without an exposure mask set, because otherwise non-native
children of the native window with an exposure mask will
not be drawn.
2013-05-07 16:40:24 +02:00
Alexander Larsson
adffcf8af6 Add gdk_window_get_children_with_user_data
This function returns all the children that has a specific user_data set.
This is used a lot in the new GtkWidget drawing code and doing
it this way is faster than getting every child and calling get_user_data
on each (which was a non-neglible part of the profiles). Additionally it
also allows use to use some kind of hashtable to make this operation even
faster if needed in the future.
2013-05-07 16:40:17 +02:00
Alexander Larsson
e13fb1d3e0 Add gdk_window_set_invalidate_handler
This lets you register callbacks for when child widgets invalidate
areas of the window read it and/or change it.

For instance, this lets you do rendering effects and keeping offscreen
caches uptodate.
2013-05-07 16:34:04 +02:00
Alexander Larsson
6115961175 gdkwindow: Make GdkPaintable normal GdkWindowImpl vfuncs
There is no need for this to be a separate interface, its just looking
weird.
2013-05-07 16:33:01 +02:00
Alexander Larsson
e09b4fa029 gdkwindow: Change how paints work
First of all, we now only do paints on native windows, as there is
really no reason anymore to do it for subwindows. Secondly, we
keep track of the paints even for GtkPaintable windows, but for
that case we don't create the offscreen surface, but rather
assume the windowing system does the backing store.
2013-05-07 16:33:01 +02:00
Alexander Larsson
e0ca53ff7c gdkwindow: Simplify invalidation
Now that all windows are non-opaque we can simplify the invalidation
a lot. There is no need to clip the invalidate area to child regions,
because we will always redraw everything under all the children.
We only have to handle native childen specially.
2013-05-07 16:33:01 +02:00
Alexander Larsson
fe0982818d gdkwindow: Remove implicit paints
We now only do one expose event per native window, so there will
only be one begin/end_paint() call. This means all the work with
implicit paints to combine the paints on a single double buffer
surface is unnecessary, so we can just delete it.
2013-05-07 16:33:01 +02:00
Alexander Larsson
d22fd7223c Only handle exposes on native window, propagate to children via draw()
We now consider non-native windows non-opaque, which means any invalid
area in a subwindow will also be invalid all the way up to the nearest
native windows. We take advantage of this by ignoring all expose events
on non-native windows (which typically means just the toplevel) and instead
propagating down the draw() calls to children directly via
gtk_container_propagate_draw.

This is nice as it means we always draw widgets the same way, and it
will let us do some interesting ways in the future.

We also clean up the GtkWidget opacity handling as we can now always
rely on the draing happening via cairo.

We can't really just draw by walking down the widget hierarchy, as
this doesn't get the clipping right (so e.g. widgets doing cairo_paint
may draw outside the expected gdkwindow subarea) nor does it let
us paint window backgrounds.

So, we now do multiple draws for each widget, once for each GdkWindow,
although we still do it on the same base cairo_t that we get for the
toplevel native window. The difference is only the clipping, the rendering
order, and which other widgets we propagate into.

We also collect all the windows of a widget so we can expose them inside
the same opacity group if needed.

NOTE: This change neuters gtk_widget_set_double_buffered for
widgets without native windows. Its impossible to disable
the double buffering in this model.
2013-05-07 16:33:01 +02:00
Alexander Larsson
fc645f2865 gdkwindow: Remove ancient USE_BACKING_STORE define
This is always set anyway.
2013-05-07 16:33:01 +02:00
Alexander Larsson
1f986ff953 gdkwindow: Simplify clip region calculations
Since we no longer make overlapping siblings affect clip_region we
can further simplify the clip region calculation and updating.
2013-05-07 16:33:01 +02:00
Alexander Larsson
5773cf237c gdkwindow: Simplify clip region handling
Since we dropped the move region optimization there is really no need
to try carefully keep track of opaque non-overlapped regions, as we
don't use this information to trigger the optimization anymore.

So, by assuming that all windows are non-opaque we can vastly simplify
the clip region stuff. First of all, we don't need clip_region_with_children,
as each window will need to draw under all children anyway. Secondly, we
don't remove overlapping sibling areas from clip_region, as these are
all non-opaque anyway and we need to draw under them

Finally, we don't need to track the layered region anymore as its
essentially unused. The few times something like it is needed we can
compute it explicitly.

For the case of native children of widgets we may cause a repaint
under native windows that are guaranteed to be opaque, but these
will be clipped by the native child anyway.
2013-05-07 16:33:01 +02:00
Alexander Larsson
da2a1eac1b gdkwindow: Remove outstanding_moves stuff
Since we now never move regions directly on the window we can
remove all the stuff that track outstanding moves and flushes then.
2013-05-07 16:33:00 +02:00
Alexander Larsson
6a478ea672 gdk: Don't ever do copies from the window
This basically neuters gdk_window_move_region, gdk_window_scroll
and gdk_window_move_resize, in that they now never copy any bits but
just invalidate the source and destination regions. This is a performance
loss, but the hope is that the simplifications it later allows will let
us recover this performance loss (which mainly affects scrolling).
2013-05-07 16:33:00 +02:00
Alexander Larsson
645f6435e5 gdkwindow: Handle updates created by outstanding moves in same update
If gdk_window_flush_outstanding_moves() creates new update area
we handle this directly in the same draw to avoid flashing.

This mainly affects win32 as X11 does its exposes from moves async.
However, its important for win32 since ScrollDC seems to sometimes
invalidate (and not copy) unexected regions.

http://bugzilla.gnome.org/show_bug.cgi?674051
2013-04-11 12:15:30 +02:00
Alexander Larsson
9011a79ed2 Make gdk_flush_outstanding_moves "reentrant"
If do_move_region_bits_on_impl causes updates they will propely
be moved by the outstanding moves we have not yet flushed.
2013-04-11 11:35:17 +02:00
Alexander Larsson
9cc64579c2 gdkwindow: Apply layered areas to the shape for native windows
If a window is overlapped by a layered (i.e. partially transparent)
window then that region will not disappear from the native window clip
region. This lets us handle compositing multiple layers of windows.

For native subwindows this doesn't really work. For them we apply the
clip region as a shape to the native window which lets us have client
side windows overlapping the native window. However, with the addition
of the layered stuff the "overlapped-by-alpha-csw" part got broken, as
this area is not removed from the clip region of the native window.

We fix this by also removing the layered area when applying the shape.
This means alpha and alpha backgrounds don't work over native windows,
but there is not much to do about that.

https://bugzilla.gnome.org/show_bug.cgi?id=696370
2013-03-27 12:02:27 +01:00
Alexander Larsson
6374873dcb gdkwindow: Add alpha_bg to window debug print 2013-03-27 12:02:25 +01:00
Chun-wei Fan
b9e189150b gdk/gdkwindow.c, gtk/gtkwidget.c: Include fallback-c89.c
Both of them started to make use of round(), a C99 function.  So, include
fallback-c89.c to provide a fallback implementation for round() for
compilers that don't have round()

https://bugzilla.gnome.org/show_bug.cgi?id=694339
2013-03-13 13:22:48 +08:00
Alexander Larsson
8ee578468d gdkwindow: Update window debug dump code
This makes it build without warning and also dumps alpha
2013-03-01 14:55:54 +01:00