Commit Graph

105 Commits

Author SHA1 Message Date
Benjamin Otte
5e4672092a gdk: Deprecate static gravities
... and remove all implementations. The API allows to not work "if the
server doesn't support it. So from now on, no server does!
2014-10-06 02:38:40 +02:00
Jasper St. Pierre
58715796d2 gdkwindow: Provide a default implementation of process_updates_recurse
As a quick code cleanup.
2014-06-22 10:20:50 -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
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
Matthias Clasen
92e30dadc2 GdkOffscreenWindow: Fill in a few more vfuncs
Mostly to avoid special cases in testcases.
2014-06-09 13:31:03 -04: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
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
Jasper St. Pierre
b922e0e213 Remove the return value of GdkWindowImpl::get_root_coords
It's unused by callers, and the historical return values are
undocumented, so just remove it now.
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
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
Chun-wei Fan
ce30d16da1 gdk/gdkoffscreenwindow.c: Include fallback-c89.c
This is necessary as we are using round() here, which is not universally
available.
2013-07-19 18:33:42 +08:00
Matthias Clasen
f636a2668b Don't segfault when setting opacity on an offscreen window
This was causing the treeview tests to fail.
2013-07-09 20:05:46 -04: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
30080faf2b offscreenwindow: Handle window_scale
We create similar windows in the right way to get the
device scale right.
2013-07-03 14:34:13 +02:00
Alexander Larsson
19560bf0d4 gdkwindow: Remove translate vfunc
This is not used anymore
2013-05-07 16:33:00 +02:00
Tristan Van Berkom
6a90c48ea6 GdkOffscreenWindow: Implement gdk_window_get_frame_extents()
This avoids crashes in gtk_window_get_position() whenever the GdkWindow
is offscreen.
2013-04-06 17:16:09 +09:00
Cosimo Cecchi
7babd3847a gdk: fix the build
Regression from commit 861c57e304
2012-05-15 13:27:21 -04:00
Bastien Nocera
861c57e304 gdkoffscreenwindow: Don't crash when resetting cursor
When the toplevel is a GdkOffscreenWindow which doesn't
implement the set_device_cursor() vfunc, we would have
crashed. Implement a dummy ->set_device_cursor vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=675809
2012-05-15 18:05:36 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Alexander Larsson
42c2d51ad9 Always make offscreen window rgba
This fixes issues where the new default bg of transparent
didn't work, making offscreen windows black.

I don't think this is a practical performance problem.
Offscreen windows are rarely used and generally used for
graphics tricks like alpha anyway.
2012-02-13 15:06:09 +01:00
Juan Pablo Ugarte
704dd8327f Fixed bug #654125 "gdkoffscreenwindow set any impl handlers to null but adhoc gdk_window_set_* do not cope" 2011-07-08 19:27:00 -03:00
Tristan Van Berkom
d2303bafae Fix some crashes caused by unimplemented functions in GdkOffscreenWindow
These crashes happen when accessing GtkWindow properties and the
GdkWindow is an offscreen (fixes https://bugzilla.gnome.org/show_bug.cgi?id=647244)
2011-04-09 02:00:18 +09:00
Tristan Van Berkom
b51f3ffffc Added set_transient_for() implementation for GdkOffscreenWindow
Just a noop that is better than crashing in the case this is called
(it can be called for a toplevel GtkWindow that is parented into
another widget by setting gtk_widget_set_parent_window to an offscreen
window).
2011-02-03 23:52:12 +09:00
Matthias Clasen
454c36523a Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 18:50:09 -05:00
Matthias Clasen
46903a9100 Fix a crash during DND
https://bugzilla.gnome.org/show_bug.cgi?id=640105
2011-01-20 21:36:50 -05:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Tristan Van Berkom
89eb869ecf Avoid crashes calling gdk_window_enable_synchronized_configure() on an offscreen window.
Just added gdk_offscreen_window_do_nothing() noop stub in that slot.
2011-01-13 17:03:14 +09:00
Kristian Rietveld
48b6b939d3 Implement process_updates_recurse for GdkOffscreenWindow
Makes offscreen windows work again.
2010-12-22 20:41:39 +01:00
Matthias Clasen
928fd84ebf Implement some more vfuncs in GdkOffscreenWindow 2010-12-21 14:20:19 -05:00
Benjamin Otte
d55073fde6 gdk: Remove depth argument from GdkWindowImpl->get_geometry() 2010-12-06 01:02:52 +01:00
Benjamin Otte
17a0a467a1 gdk: Pass the GdkWindow to resize_cairo_surface vfunc
So it's in sync with all the other vfuncs.
2010-12-02 20:21:04 +01:00
Benjamin Otte
d1700d6e3c gdk: Move ref_cairo_surface from GdkDrawable to GdkWindowImpl
Also make it take the actual GdkWindow, not the implementation, like all
the other vfuncs do.
2010-12-02 20:21:03 +01:00
Benjamin Otte
1bb6f48bb3 gdk: Rename GdkWindowObject to GdkWindow
... and remove most of the casting that used to be necessary.
2010-12-02 20:21:03 +01:00
Benjamin Otte
7acb64f983 gdk: Make GdkWindowImpl a class, not an interface
It's a subclass of GdkDrawable and the baseclass for GdkWindowImplX11
etc now.
2010-12-02 20:21:02 +01:00
Benjamin Otte
62622a94ae gdk: Pass Drawable as argument
We're not passing a GdKWindow here, but the implementation.
2010-12-02 20:21:02 +01:00
Benjamin Otte
072498ae87 gdk: Make _gdk_window_ref_cairo_surface() protected and use it
... instead of _gdk_drawable_ref_cairo_surface() where appropriate.
Also, don't implement the drawable->create_cairo_surface vfunc anymore.

This is in preparation for the split of GdkWindow from GdkDrawable.
2010-12-02 20:21:02 +01:00
Milan Bouchet-Valat
2e3935ba9d Fix missing (transfer) annotations in GDK
Mostly missing (transfer none).
2010-11-24 21:37:20 +01:00
Michael Natterer
0f2d1547f8 gdk: add alpha to the offscreen window's surface if its visual is RGBA 2010-10-20 17:44:23 +02:00
Matthias Clasen
bda1f35585 Inclusion cleanups in sources
Try to do inclusions in the same sequence, more or less.
2010-10-14 22:09:36 -04:00
Michael Natterer
9d9742f1e5 Bug 631599 - Allow to use arbitrary surfaces for offscreen windows
Add signal GdkWindow::create-surface which allows to use any
surface type as storage for offscreen windows.

Test the new signal in tests/gdkoffscreenbox.c
2010-10-14 13:25:23 +02:00
Michael Natterer
bef6c0a4a3 Bug 631599 - Allow to use arbitrary surfaces for offscreen windows
As a first step, create surfaces lazily and factor surface creation
out to a single function.
2010-10-12 11:34:20 +02:00
Kristian Rietveld
eca2af5230 Make set_cairo_surface_size a vfunc on GdkWindowImpl
Note the special implementation of this method on GdkOffscreenWindow
that makes sure its current surface is not destroyed.
2010-10-05 15:38:23 +02:00
Michael Natterer
06773b1e8b gdk: remove "screen" member from GdkOffscreenWindow, it has become obsolete
Also remove screen parameter from _gdk_offscreen_window_new() and get
rid of a bunch on includes in gdkoffscreenwindow.c
2010-09-28 16:05:38 +02:00
Benjamin Otte
fd200f07f5 gdk: No need to clear offscreen window when showing
I don't think it's necessary to clear the backing surface when showing
the window, as we're going to repaint it anyway. If it's needed, we can
implement it again using internal APIs, as the public window_clear()
APIs are going away.
2010-09-26 15:11:43 +02:00
Benjamin Otte
04d5c477aa API: Remove gdk_drawable_get_colormap()
And with it, remove any notion of colormaps from GdkWindow. In
particular, X11 windows will now not set attrs.colormap when calling
XCreateWindow.
2010-09-26 15:11:33 +02:00
Benjamin Otte
f08254074c API: Remove colormap member from GdkWindowAttr
Also remove all code that cares about differing colormaps for child
windows.
2010-09-26 15:11:33 +02:00
Benjamin Otte
b5097de481 gdk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
a6ef356107 API: Remove drawable getters for visual, screen and depth
Removed and replaced are:
gdk_drawable_get_visual() => gdk_window_get_visual()
gdk_drawable_get_screen() => gdk_window_get_screen()
gdk_drawable_get_depth()  => gdk_visual_get_depth
                                          (gdk_window_get_visual())
2010-09-26 15:11:33 +02:00
Benjamin Otte
eee6c002d1 gdk: store the visual in the GdkWindowObject 2010-09-26 15:11:32 +02:00
Benjamin Otte
894d402c0f API: Remove gdk_drawable_set_colormap() 2010-09-26 15:11:32 +02:00