Commit Graph

1026 Commits

Author SHA1 Message Date
Benjamin Otte
e9629a5149 wayland: Fix initial cursor
Make sure the initial cursor isn't random which would happen due to an
early exit when cursor == pointer->cursor triggered because both were
NULL.
2017-11-15 19:07:17 +01:00
Benjamin Otte
4c4e914806 gdk: Replace GDK_NONE with NULL 2017-11-15 19:07:17 +01:00
Benjamin Otte
cb941956d3 gdk: Turn GdkAtom into a const char *
Instead of an integer, it is now a char pointer. We also use
g_intern_string() instead of doing the interning ourselves.
2017-11-15 19:07:17 +01:00
Benjamin Otte
fb94f79094 selection: Remove #ifdef WAYLAND
Instead, turn the functions into backend API:
  gdk_broadway_display_add_selection_targets()
  gdk_broadway_display_clear_selection_targets()
Remove the old per-backend functions, too.
2017-11-15 19:07:16 +01:00
Benjamin Otte
ed1b6a9bed gdkwindow: Remove event_mask arguments from constructors 2017-11-13 23:41:38 +01:00
Matthias Clasen
73a3d4b785 wayland: Drop an unused function
We no longer create a root window, so need to have
a function for it.
2017-11-07 07:43:09 -05:00
Matthias Clasen
6261f5f7b8 wayland: Drop the root window
We can just keep a list of toplevels in the display.
2017-11-06 18:52:37 -05:00
Matthias Clasen
20fab69c38 Drop gdk_display_get_root_window
This is no longer used.
2017-11-05 21:45:51 -05:00
Matthias Clasen
2eb78a2374 wayland: Stop using gdk_display_get_root_window
We can just use the display field directly.
2017-11-05 19:44:39 -05:00
Matthias Clasen
909330f347 wayland: Fix animated cursors
We must reset the image delay when stopping the timeout,
otherwise the code setting it up thinks it is still running.

This fixes cursor animation only working for the very first
enter of a widget with an animated cursor, as seen in the
cursors example in gtk4-demo.
2017-11-05 11:27:06 -05:00
Benjamin Otte
e484af8e96 wayland: Fix embarassing bug
Yes, I did not get to test this code path until now. Because nobody uses
icon surfaces, boo!
2017-11-05 00:07:18 +01:00
Benjamin Otte
7e137b2524 gdk: Use G_N_ELEMENTS() when iterating over constant arrays
And do that everywhere.

Because if we don't, we're gonna crash sometimes.
2017-11-05 00:07:18 +01:00
Benjamin Otte
d092e8dd78 gdk: Fix fallback names for the help cursor 2017-11-05 00:07:18 +01:00
Benjamin Otte
9323d098a6 gdk: Cursors no longer have a display
Change constructors to reflect that.

While doing so, also add a fallback argument to the cursor constructors,
so it is now possible to create cursors with fallback.
2017-11-04 00:07:13 +01:00
Benjamin Otte
4e7a056777 gdk: Cursors are created generically
There are no longer subclasses for cursors now.
2017-11-04 00:07:13 +01:00
Benjamin Otte
ec824b9e50 wayland: Redo cursor handling
This is in line with the X11 changes last patch.
2017-11-04 00:07:13 +01:00
Benjamin Otte
5adf21a17d cursor: Turn new_from_surface() into new_from_texture()
Also turn all the arguments into read-only properties on the GdkCursor
object.
2017-11-04 00:07:13 +01:00
Benjamin Otte
81c2bebaca gdk: Remove ability to download a cursor 2017-11-04 00:07:13 +01:00
Benjamin Otte
8ba9ae6012 gdk: Add gdk_cursor_get_name()
Also add the GdkCursor::name property.
2017-11-04 00:07:13 +01:00
Benjamin Otte
a1759a0a52 gdk: Get rid of GdkCursorType
Now that we no longer have API that uses cursor types, don't keep them
around.
2017-11-04 00:07:13 +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
6ba48bd0d8 Drop foreign window checks in Wayland
The wayland backend never creates foreign windows,
so no need to check for this type of window.
2017-11-01 22:55:27 -04:00
Matthias Clasen
5bd8884bf8 Stop providing the owner in GdkEventOwnerChange
This information is rarely useful, and it is one
of the last places where we create foreign windows.
2017-11-01 22:53:24 -04:00
Matthias Clasen
3a5b478e0f wayland: Some cursor cleanups
Remove methods that are not used.
2017-11-01 22:35:19 -04:00
Matthias Clasen
c958818631 Some forgotten cleanups 2017-11-01 21:53:50 -04:00
Matthias Clasen
2a60928157 t Remove gdk_cursor_new_for_display
The preferred api to create cursors is by name, and the
GdkCursorType enumeration can directly trace its ancestry
to the horrible X cursor font. So lets stop using it.
2017-11-01 21:49:05 -04:00
Matthias Clasen
0f9e9a9ec2 wayland: No more screen
This gets rid of the GdkWaylandScreen object and all
remnants of GdkScreen in the wayland backend.
2017-11-01 19:44:29 -04:00
Matthias Clasen
7f0b5297c6 Drop gdk_display_get_default_screen
Also remove the backend implementations.
This api is no longer used.
2017-11-01 19:44:28 -04:00
Benjamin Otte
9b0d9aa7a6 wayland: Remove unused variable 2017-11-01 20:09:06 +01: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
e424dcb049 wayland: Stop using ::monitors-changed
Instead of connecting to this signal for every single window,
walk the window tree from the root window.
2017-10-31 21:48:58 -04:00
Matthias Clasen
67cea50383 Drop gdk_get_default_root_window
This is a trivial convenience function, and it is barely used.
2017-10-31 21:30:59 -04:00
Matthias Clasen
524fcbecfd Drop gdk_screen_get_root_window
This function is no longer used.
2017-10-31 21:28:28 -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
5cb5bdf1bc Add gdk_display_get_toplevel_windows
This is replacing the corresponding GdkScreen api, which
is going away. To implement this, we need to add a
get_root_window vfunc to GdkDisplay.
2017-10-31 20:29:48 -04:00
Matthias Clasen
01dfb49bbe Drop the screen resolution api
GTK+ now uses the gtk-xft-dpi setting directly.

Note: this commit only fixes the backends that
currently provide this setting. The win32 and
Quartz backends still need to be fixed.
2017-10-31 19:13:21 -04:00
Matthias Clasen
a27bfaa0a3 Drop the GDK_DPI_SCALE variable
It complicates the dpi handling, and was really just a workaround
for non-dpi aware applications when hidpi support was first introduced.
2017-10-31 18:37:54 -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
Matthias Clasen
a3cffa5072 Drop GdkScreen from GdkDevice apis
Returning the screen does not add anything here and
GdkScreen is going away.
2017-10-31 12:30:38 -04:00
Matthias Clasen
f8cad19829 dnd: Drop GdkScreen from apis
Drop the screen argument from gdk_dnd_find_window_for_screen
and rename the function to gdk_dnd_find_window. The screen
argument does not add anything here since the drag context
is already tied to the display. Update all backends, and
update all callers.
2017-10-31 10:18:10 -04:00
Matthias Clasen
ba91af62ad Drop gdk_app_launch_context_set_screen
This function is not necessary, since we already know the display.
2017-10-30 23:01:34 -04:00
Matthias Clasen
525e2a7944 gdk: Stop using gdk_event_set_screen
Use gdk_event_set_display instead.
2017-10-30 22:22:00 -04:00
Matthias Clasen
d9809df8ce wayland: Stop using gdk_screen_get_setting
Use gdk_display_get_setting instead.
2017-10-30 17:01:46 -04:00
Matthias Clasen
2a4da2cfcd wayland: Don't set the GdkScreen get_setting vfunc
We are not using it anymore.
2017-10-30 16:52:39 -04:00
Matthias Clasen
4ffe9ca70c wayland: Implement the GdkDisplay get_setting vfunc
Just call the GdkScreen vfunc.
2017-10-30 16:43:50 -04:00
Matthias Clasen
5d4c979425 wayland: Stop emitting setting events
Not needed anymore.
2017-10-30 09:49:02 -04:00
Matthias Clasen
3c0614994f wayland: Emit GdkDisplay::setting-changed
We still generate the event too.
That will be removed in a future commit.
2017-10-30 09:28:29 -04:00
Olivier Fourdan
999848e0c6 wayland: scale down reported monitor geometry
According to the documentation, gdk_monitor_get_geometry() reports the
monitor geometry in ”application pixels”, not in ”device pixels”,
meaning that the actual device resolution needs to be scaled down by the
scale factor of the output.

x11 backend does that downscaling, whereas Wayland backend did not,
causing a discrepancy depending on the backend used.

https://bugzilla.gnome.org/show_bug.cgi?id=783995
2017-10-27 16:01:38 -04:00
Drew DeVault
1b279e3d4a Wayland: Implement KDE's SSD protocol
If the compositor prefers server-side decorations and the client doesn't
customize the title bar, we disable client-side decorations and let the
compositor know. Otherwise, we continue to use client-side decorations.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781909
2017-10-26 15:51:56 -04:00
Olivier Fourdan
028e39d6ee wayland: Do not constrain saved window size
Under Wayland, an xdg_surface.configure with size 0x0 means it's up to
the client to set its size.

When transitioning from maximized state to un-maximized, the Wayland
compositor will send such an 0x0 configure so that the client can
restore its original size.

However, the original size was already constrained, so re-applying
size constrains can lead to a smaller size when using size increments.

Avoid this caveat by not applying size constrains when we are restoring
the original size.

https://bugzilla.gnome.org/show_bug.cgi?id=777072
2017-10-26 15:49:42 -04:00