Commit Graph

1066 Commits

Author SHA1 Message Date
Benjamin Otte
182d18bcd1 gdk: Large GL refactoring
No visible changes as GL rendering is disabled at the moment.

What was done:

1. Move window->invalidate_for_new_frame to glcontext->begin_frame
This moves the code to where it is used (the GLContext) and prepares it
for being called where it is used when actually beginning to draw the
frame.

2. Get rid of buffer-age usage
We want to let the application render directly to the backbuffer.
Because of that, we cannot make any assumptions about the contents the
application renders outside the clip area.
In particular GskGLRenderer renders random stuff there but not actual
contents.

3. Pass the actual GL context
Previously, we passed the shared context to end_frame, now we pass the
actual GL context that the application uses for rendering. This is so
that the vfuncs could prepare the actual contexts for rendering (they
don't currently).

4. Simplify the code
The previous code set up the final drawing method in begin_frame.
Instead, we now just ensure the clip area is something we can render
and decide on the actual method in end_frame.
This is both more robust (we can change the clip area in between if we
want to) and less code.
2016-12-05 15:02:47 +01:00
Benjamin Otte
4967257f3a gdk: Don't recurse when processing updates
We don't need to send expose events for backwards compatibility anymore.
2016-12-05 15:02:47 +01:00
Benjamin Otte
bddfd7bb41 gdk: Remove all code that only existed because of use_gl
Now that we don't use GL anymore, this code is unnecessary.
2016-12-05 15:02:47 +01:00
Benjamin Otte
77d336de17 gdk: Never draw with GL
This is a temporary switch-off of the GL dawing code that will make
things keep running. All GL related code (like the GSK renderer or
GtkGLArea will now fall back to software.
2016-12-05 15:02:47 +01:00
Benjamin Otte
332ed7be5b API: Require passing a GLContext to begin_draw_frame()
This is in preparation for requiring explicit passing of GL contexts
when drawing.
2016-12-05 15:02:47 +01:00
Benjamin Otte
9c041f6bcc window: Change behavior of gdk_window_begin_draw_frame()
(1) Require a native window
(2) Create the drawing context before calling begin_paint().
2016-12-05 15:02:47 +01:00
Olivier Fourdan
f6b4477393 wayland: destroy subsurfaces along with parents
Wayland subsurfaces can have other native window parents, but those need
to be destroyed along with the rest of the window hierarchy otherwise
an assert() is reached.

https://bugzilla.gnome.org/show_bug.cgi?id=774915
2016-12-05 10:56:41 +01:00
Benjamin Otte
efd04b47aa gdk: Make GdkDrawingContext not per-backend
No backend is using it, and we can put the backend-specific drawing code
into GdkGLContext.
2016-11-30 15:52:22 +01:00
Olivier Fourdan
bd4519922c wayland: Check for subsurface looking up the toplevel
gdk_window_get_toplevel() walks up the windows tree looking for the
corresponding toplevel window, but needs to account for subsurfaces as
well on Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=775319
2016-11-30 10:05:47 +01:00
Benjamin Otte
624e0e1409 gdk: Rewrite docs some more
Now gdk_window_process_updates() isn't mentioned either.

GDK takes care of redrawing, not you!
2016-11-24 18:31:11 +01:00
Benjamin Otte
4b6e70b9c8 gdk: Get rid of all mentions of process_all_updates() 2016-11-24 15:26:49 +01:00
Olivier Fourdan
39200e75b6 wayland: Place subsurfaces relative to their parent
Now that subsurfaces can be created as child of another GdkWindow (and
not just the root window), they must be placed according to the location
of their parent, i.e. the abs_x/abs_y must be updated and taken int
account when placing and moving subsurfaces under Wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=774917
2016-11-24 09:32:41 +01:00
Benjamin Otte
ae29d4db5a gdk: Use stricter checks for begin_draw_frame()
We don't support drawing on child windows, so make sure nobody tries.
2016-11-24 04:43:42 +01:00
Benjamin Otte
0cb35bf394 gdk: Only draw toplevels
Simplify gdk_window_paint_on_clock () to only draw the toplevel. We do
no longer draw child windows and offscreens no longer exist.
2016-11-23 19:32:27 +01:00
Benjamin Otte
2a27b7ecc6 API: Remove gdk_window_process_all_updates()
It's completely unused since we have a frame clock.
2016-11-23 19:10:34 +01:00
Benjamin Otte
ef75ca2d53 API: gdk: Remove gdk_window_process_updates()
We have a frame clock now.
2016-11-23 19:02:58 +01:00
Benjamin Otte
e62a4d8eea API: gdk: Remove ability to render window contents
The functions gdk_pixbuf_get_from_window() and
gdk_cairo_set_source_window() are unreliable and depend on the windowing
system (they work great on X11 and Win32, less so on Quartz and Wayland).

With the switch to new drawing API and OpenGL, we can definitely no
longer support a generic way to snapshot windows.

People should either write windowsystem-specific code or draw their
widgets directly - like with gtk_widget_draw() - if they need to get a
rendering.
2016-11-20 11:47:44 +01:00
Benjamin Otte
1492175a28 window: Remove unused destroy_draw_context vfunc 2016-11-20 07:27:00 +01:00
Benjamin Otte
cb18752f94 gdk: Make each backend have a custom GdkDrawingContext subclass 2016-11-20 07:19:52 +01:00
Olivier Fourdan
36575a4424 gdkwindow: Allow native subsurface for all parents
Under Wayland, a subsurface can have another surface as parent, but
gdk would not allow native windows if the parent is not the root window.

Allow native subsurface for all parent under Wayland, not just for the
root window.

https://bugzilla.gnome.org/show_bug.cgi?id=774475
2016-11-18 13:25:36 -05:00
Olivier Fourdan
4ae1eab3b1 Revert "gdkwindow: configure native windows in move_native_children()"
This reverts commit 9e2b1ad39e.
2016-11-14 12:24:18 +01:00
Olivier Fourdan
5ccc570cca Revert "gdk: Get rid of unused variables"
This reverts commit 7016409e9f.
2016-11-14 12:24:18 +01:00
Benjamin Otte
b04e25f29b gdk: gdk_window_new() is not called for foreign windows
So we can remove the special cases that were used for them.
2016-11-07 03:15:00 +01:00
Benjamin Otte
d2c26c471c gdk: Remove attributes_mask from gdk_window_new()
The only remaining values were always treated as 0, so we just hardcode
them to 0.
2016-11-07 01:33:43 +01:00
Benjamin Otte
3b93773add API: gdk: Add gdk_window_new_temp()
Your one stop shop for all those nasty hidden input-only windows.
2016-11-07 01:03:17 +01:00
Benjamin Otte
24d0baec38 API: gdk: Add gdk_window_new_popup()
... and use it.
2016-11-06 23:47:56 +01:00
Benjamin Otte
87f07bac6b API: gdk: Add gdk_window_new_toplevel()
... and use it in GTK.
2016-11-06 17:40:59 +01:00
Benjamin Otte
33e7a7898f API: gdk: Remove gdk_window_set_override_redirect()
When you want an override-redirect window, you create it that way.
Changing that behavior is not supported anywhere (but on X of course).
2016-11-05 03:32:27 +01:00
Benjamin Otte
4585af5719 gdk: Remove visual APIs from GdkScreen
gdk_screen_list_visuals(), gdk_screen_get_system_visual() and
gdk_screen_get_rgba_visual() are gone now.
2016-11-04 00:02:37 +01:00
Benjamin Otte
f420dc7456 API: gdk: Remove gdk_window_get_visual()
With it, remove window->visual.
2016-10-28 05:22:49 +02:00
Benjamin Otte
6cc94ff176 gdk: Remove GdkWindow.depth member variable
It's unused.
2016-10-28 05:22:32 +02:00
Benjamin Otte
cd67c0d7cc window: Add a GdkWindow:display property
... and make it an explicit property of the window struct instead of
looking it up in the visual.
2016-10-28 04:45:35 +02:00
Benjamin Otte
dd105f3db8 gdk: Remove gdk_window_set_invalidate_handler()
It's not used anymore.
2016-10-27 05:03:06 +02:00
Benjamin Otte
b1f61b6fcc gdk: Add deprecation guards around deprecated function 2016-10-27 05:03:06 +02:00
Matthias Clasen
42a5608af6 Fix the build
Copy-paste error.
2016-10-26 10:45:04 -04:00
Matthias Clasen
9aa1257bd0 GdkWindow: Use the seat to enumerate devices
GdkDeviceManager is going away.
2016-10-26 10:36:32 -04:00
Matthias Clasen
5e4a05e5b7 Remove deprecated gdk_window_get_pointer 2016-10-25 19:45:48 -04:00
Matthias Clasen
0ba67021a9 Remove an unused function
This function is no longer used, now that offscreen windows are gone.
2016-10-25 15:32:02 -04:00
Alexander Larsson
70935f0952 Drop support for offscreen GdkWindows
These complicate a lot of GdkWindow internals to implement features
that not a lot of apps use, and will be better achieved using gsk.
So, we just drop it all.
2016-10-25 09:54:37 +02:00
Rico Tzschichholz
639898000e gdkwindow: Remove deprecated API 2016-10-24 12:22:32 +02:00
Rico Tzschichholz
16ded8d47b gdk: Remove deprecated {keyboard,pointer}_{grab,ungrab} API 2016-10-24 10:33:11 +02:00
Rico Tzschichholz
310a1f7e90 gdk: Add missing Since tags for gdk_window_new_child/input
In addition to d22e5e69d9
2016-10-18 13:27:19 +02:00
Benjamin Otte
d22e5e69d9 API: gdk: Add gdk_window_new_child() and gdk_window_new_input()
This is an attempt to get rid of gdk_window_new() for more specific use
cases. These 2 are for client-side windows - regular ones and input-only
ones resepectively.

So far all those functions just call into gdk_window_new().
2016-10-18 00:22:35 +02:00
Emmanuele Bassi
cf9b9a034b gdk: Comment out gdk_cairo_create() 2016-10-17 10:44:27 +01:00
Benjamin Otte
a65a4de38d gdk: Remove old code to create drawing context
You now have to use a GdkDrawingContext
2016-10-16 18:18:58 +02:00
Benjamin Otte
e76ba9a3c3 gdk: Remove gdk_window_set_debug_updates()
The update tracking code was ugly and using deprecated drawing APIs. It
was also in the wrong place.

So instead of trying to keep it working, I'll remove it. We need to find
a better way to put it and make it work there.
2016-10-16 18:18:58 +02:00
Benjamin Otte
eace2cf421 API: Remove gdk_window_set_background()
Backgrounds are always transparent black.
2016-10-16 18:17:21 +02:00
Benjamin Otte
662001b60a API: Remove ability to set visuals on windows
And with it, gtk_widget_get_visual() and gtk_widget_set_visual() are
gone.

We now always use the RGBA visual (if available) and otherwise fall back
to the system visual.
2016-10-16 18:17:21 +02:00
Benjamin Otte
89f2e17f91 API: Remove gdk_window_set_composited()
And the related call gdk_display_supports_composite().
2016-10-16 18:17:21 +02:00
Benjamin Otte
fcbd480c76 API: Remove GDK_WA_CURSOR
The cursor was set using gdk_window_set_cursor() even in
gdk_window_new().

So instead of having yet another flag, just make the users of that flag
call gdk_window_set_cursor() directly after the window was created.
2016-10-16 18:17:21 +02:00