Commit Graph

641 Commits

Author SHA1 Message Date
Matthias Clasen
8ced2c6478 x11: Stop using GdkScreen altogether
Derive GdkX11Screen directly from GObject, and
remove the last remaining uses of GdkScreen.
2017-11-17 10:51:55 -05:00
Matthias Clasen
2daa7d1a53 x11: Stop using GdkScreen in api
This type is going away, so switch to using GdkX11Screen
everywhere.
2017-11-17 10:51:55 -05:00
Matthias Clasen
d73898437f x11: Add gdk_x11_display_set_program_class
The program class is a very X-specific concept.
There should be x11-backend api to deal with it.
2017-11-16 23:21:06 -05:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Matthias Clasen
5f73afae3d x11: Remove mentions of GDK_WINDOW_ROOT
This backend never creates a window of this type, so no
need to check for it anymore.
2017-11-13 16:47:50 -05:00
Matthias Clasen
964cdaf3a3 x11: Stop creating a root window
We no longer need it.
2017-11-13 16:39:54 -05:00
Matthias Clasen
bdb442be21 x11: Reduce uses of the root window
Avoid calling the get_root_window api that returns
a GdkWindow in some places, and instead use the X
root window directly.
2017-11-09 22:52:37 -05:00
Benjamin Otte
2177b191ba x11: Correctly set icons
X11 obviously doesn't use 4 bytes for a 4 bytes pixel. Rather, it uses
unsigned long, which happens to be 8 bytes these days.
2017-11-07 12:24:43 +01:00
Matthias Clasen
063db3630b x11: Stop using gdk_display_get_root_window
Use the backend api for this.
2017-11-05 21:45:51 -05:00
Matthias Clasen
119c433882 x11: Handle parent being NULL when creating windows
We want to make toplevels have a NULL parent, this
gets us ready for it.
2017-11-05 19:25:22 -05:00
Benjamin Otte
70846c85b3 window: Make icons GdkTextures
Cairo surfaces are bad, mkay?
2017-11-05 00:07:17 +01:00
Benjamin Otte
9c98adcd15 gdk: Remove GdkWindow.set_device_cursor() vfunc
That one calls through to GdkDevice.set_window_cursor(), so let's just
use that one.
2017-11-02 12:42:58 +01:00
Matthias Clasen
fee93d8d7b x11: Stop using gdk_screen_get_display
Never necessary, we can just use the field directly.
2017-11-01 20:48:03 -04:00
Matthias Clasen
e3daf986ca x11: Stop using gdk_display_get_default_screen
There's no point in using this api here, we can directly
get the screen member from the GdkX11Display struct.
2017-11-01 19:44:28 -04:00
Matthias Clasen
606345cbaa Change the fullscreen-on-monitor api
Use GdkMonitor here, since that is our primary monitor
object now, and GdkScreen is going away.
2017-11-01 14:17:20 -04:00
Matthias Clasen
0411cc5620 Drop GdkVisual
This type was unused except for serving as a parent
for GdkX11Visual. Just move the fields to that type.
2017-10-31 22:44:15 -04:00
Matthias Clasen
463fba18a6 Port to gdk_display_get_root_window
This is the replacement for the GdkScreen api of the same name.
2017-10-31 21:27:24 -04:00
Matthias Clasen
2d6bd1ae6d Drop gdk_window_get_screen
This includes removing the GdkScreen argument from the
create_window_impl display vfunc.
2017-10-31 17:25:01 -04:00
Alexander Larsson
d3fc937b4d GtkWindow/GdkWindow: Finish converting icons to surfaces
There were some parts left, for instance gdk_window_set_icon_list.
2017-10-23 13:45:25 +02:00
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Georges Basile Stavracas Neto
0bdaebef1e window: Improve detection of edge constraint support
Instead of relying on special values of edge constraints, this
patch adds an internal-only gdk_window_supports_edge_constraints()
function that by default returns FALSE, and is implemented by
GdkWindowWayland and GdkWindowX11.

This way, we can properly detect server-side support for this
feature and adapt accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-09-17 23:16:48 -03:00
Matthias Clasen
c409fca703 Drop root windows from some internal apis
_gdk_device_query_state was needlessly shuffling
root windows around.
2017-08-11 15:45:23 -04:00
Timm Bäder
bf22dea2ce GdkWindow: Default to unfocused
Don't set the have_focused field of the window's toplevel to TRUE by
default and don't set the FOCUSED state in gdk_window_map. This a means
toplevel window's state is what the WM expects, and the FOCUSED state
will be set anyway when we map the window and receive a _NET_WM_STATE
message.
2017-07-19 21:27:16 -04:00
Matthias Clasen
caacab13e9 Remove the gdk backend API too
The GTK+ level API for this is already gone.
2017-05-02 16:17:33 -04:00
Emmanuele Bassi
278e54b88d gdk: Make more private functions static
These symbols are not exported and are local to their compilation unit.
2017-04-28 23:03:10 +01:00
Benjamin Otte
7ade6e3f46 gdk: Remove testing functions
They were unused and unimplemented.
2017-01-08 03:46:30 +01:00
Alexander Larsson
330c7feaa2 gdk: Drop gdk_window_reparent
We're not currently using this, and dropping it allows us to loose
a bunch of code which leads us towards the goal of having GdkWindow
only for toplevels (and reparenting makes not sense for toplevels).
2016-12-16 12:35:03 +01:00
Alexander Larsson
5bf28a3869 gdk: Drop support for native (and thus foreign) subwindows
We can't really support these on e.g. wayland anyway, and we're trying
to get rid of subwindow at totally in the long term, so lets drop this.
It allows us to drop a lot of complexity.
2016-12-16 12:28:44 +01:00
Benjamin Otte
5e4f95d77f x11: Don't make random windows native
Instead, complain if somebody calls gdk_x11_window_get_xid() on a
non-native window.

We cannot make random windows native anymore because there's no GSK
renderer associated with them, so we cannot draw them.
2016-12-09 18:35:51 +01:00
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
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
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
cb18752f94 gdk: Make each backend have a custom GdkDrawingContext subclass 2016-11-20 07:19:52 +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
7a6cab14eb gdkwindow: Remove GdkWindowAttr.type_hint
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.
2016-11-06 16:22:21 +01:00
Benjamin Otte
b7619a2603 x11: Set override_redirect on input-only windows
b9955cfff1 broke this.
2016-11-06 15:43:06 +01:00
Benjamin Otte
9707f4d3b3 API: gdk: Remove title from gdk_window_new()
Use gdk_window_set_title() afterwards instead.
2016-11-05 03:32:27 +01:00
Benjamin Otte
b9955cfff1 API: gdk: Remove override_redirect flag from GdkWindowAttr
When you want an override-redirect window, you create it that way by
creating a GDK_WINDOW_TEMP window.
2016-11-05 03:32:27 +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
Matthias Clasen
338534fb8d Fix up the fullscreen_on_monitor support
I didn't pay attention, and forgot to port this code to the
new monitor apis.
2016-11-04 12:41:51 -04:00
Rui Matos
b8fc4c246a gdkwindow-x11: Add support for gdk_window_fullscreen_on_monitor
This way we can recommend that applications use the
fullscreen_on_monitor() API on both X and Wayland otherwise they'd
have to keep a path for each backend to achieve this functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=773857
2016-11-04 12:10:43 -04:00
Benjamin Otte
0192f93689 x11: Replace gdk_display_get_window_visual()
... with functions that don't use GdkVisual.

A small step towards getting rid of GdkVisual.
2016-11-03 22:40:36 +01:00
Benjamin Otte
d8d8059ee1 x11: Use X11 variables instead of GDK variables
This way, we avoid GdkVisual usage.
2016-11-03 20:33:33 +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
56b25e2574 x11: Remove code that temporarily unsets the background
We don't set a background anymore, so we don't need to temporarily unset
it.
2016-10-27 06:37:02 +02: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
Emmanuele Bassi
923b868400 gdk/x11: Constify argument 2016-10-17 11:10:14 +01:00
Benjamin Otte
eace2cf421 API: Remove gdk_window_set_background()
Backgrounds are always transparent black.
2016-10-16 18:17:21 +02:00