Commit Graph

7707 Commits

Author SHA1 Message Date
Matthias Clasen
efd86912f0 broadway: Drop the root window
We already have a list of toplevels, so we don't
need the root window for this.
2017-11-06 21:51:30 -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
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
5db2352eba x11: Make gdk_x11_display_get_root_window available
This will replace the frontend api of the same name.
2017-11-05 21:45:51 -05:00
Matthias Clasen
c1c919cf7d win32: Stop using gdk_display_get_root_window
Use the newly introduced backend api for this purpose.
2017-11-05 21:45:51 -05:00
Matthias Clasen
be75984485 win32: Make gdk_win32_display_get_root_window available
This will be used to replace the equivalent frontend api,
which is going away.
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
f3150c3a43 Typo fix 2017-11-05 19:43:39 -05:00
Matthias Clasen
a163d5b7a7 broadway: Stop using gdk_display_get_root_window
We can just use the field in the display.
2017-11-05 19:37:54 -05:00
Matthias Clasen
c08a6a062f Stop using the root window in gdk_window_create_similar_image_surface
Just create a plain image surface if we don't get a window.
This should work just fine and lets us drop another implicit
use of the root window.
2017-11-05 19:30:54 -05:00
Matthias Clasen
de83fc48bf Stop defaulting to the root window in gdk_window_get_geometry
This function is not documented as accepting NULL for the
window, and we don't want to have the root window sneakily
appear in the api like this.
2017-11-05 19:29:49 -05:00
Matthias Clasen
50cf11d398 Make toplevels have parent == NULL
This is a move towards removing root windows as a frontend
gdk concept.
2017-11-05 19:28:37 -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
Matthias Clasen
c16a0bd9b7 Drop gdk_display_get_toplevel_windows
Nothing uses this private api anymore, so we can drop it.
2017-11-05 18:39:01 -05:00
Matthias Clasen
28a8d03c0b x11: Drop use of gdk_display_get_toplevel_windows
Use the newly introduced helper for this task.
2017-11-05 18:36:49 -05:00
Matthias Clasen
76b6d86659 x11: Add a helper to get all toplevels
This will let us avoid frontend API for this task.
2017-11-05 18:33:56 -05:00
Matthias Clasen
e980f68f5b quartz: Drop another use of gdk_display_get_toplevel_windows
This one was forgotten in the previous commit.
2017-11-05 18:30:03 -05:00
Matthias Clasen
4f701c71f1 quartz: Drop use of gdk_display_get_toplevel_windows
We can use the newly added helper function for this.
2017-11-05 18:28:27 -05:00
Matthias Clasen
c44e693b26 quartz: Add a function to get all toplevels
This will let us avoid frontend API for this.
2017-11-05 18:27:49 -05:00
Matthias Clasen
84a3772ef6 broadway: Stop using gdk_display_get_toplevel_windows
We already keep a list of all toplevels in the broadway
display struct. Just use it.
2017-11-05 18:19:04 -05:00
Matthias Clasen
807cac2c79 quartz: Drop mentions of foreign windows
The quartz backend never creates foreign windows,
so no need to check for window type.
2017-11-05 12:09:06 -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
Matthias Clasen
65a7557fc1 Fix some typos
Correct function names in the docs, etc.
2017-11-04 23:51:25 -04: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
70846c85b3 window: Make icons GdkTextures
Cairo surfaces are bad, mkay?
2017-11-05 00:07:17 +01:00
Benjamin Otte
4c2bae3a1a texture: Add gdk_texture_new_from_file()
and gdk_texture_new_from_resource().

While doing set, turn all GDK_AVAILABLE_IN_3_90 into
GDK_AVAILABLE_IN_3_94 because that's now true after the renaming.
2017-11-04 15:22:25 +01:00
Rico Tzschichholz
7b0ed47525 x11: Make gdk_x11_display_get_xcursor be recognized as instance method 2017-11-04 13:23:02 +01:00
Chun-wei Fan
3228149892 gdk/win32: Fix Win32 GL Context switching
Since on Windows we need to use a good amount of temporary GL contexts,
we need to switch back to the original GL contexts we were using when
we are done with the temporary GL contexts, otherwise multi-GL windows
will cause confusions causing display artifacts and crashes.

Also, use the GdkWin32GLContext::gl_hdc consistently throughout
the code and remove the GdkWin32Display::gl_hdc as Lukas K pointed out
that GdkWin32Display::gl_hdc becomes out-of-date and so the HDC that the
GL context is bound to becomes incorrect in sceanarios using multiple
windows with GtkGLArea/GdkGLArea items (which would cause the artifacts in
programs that use multiple windows with GtkGLArea/GdkGLArea items, and it
turns out that GdkWin32Display::gl_hdc is actually not necessary to help
keep track of the HDCs we use for our GL contexts.

This will also fix on Windows with GDK_GL=always, or when GSK's gl
renderer is used.

Partly based on patch from Lukas K <lu@0x83.eu>

https://bugzilla.gnome.org/show_bug.cgi?id=789213
2017-11-04 10:39:03 +08:00
Chun-wei Fan
6a12a3cd10 gdk/win32: Fix build after GdkScreen and cursor cleanups
Move the leftovers from the removals to use the current APIs, to fix the
build.  Also for gdk_device_virtual_set_window_cursor(), only do
something when a valid GdkCursor is passed in here.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-11-04 10:32:21 +08:00
Benjamin Otte
d78bbb7e96 x11: Don't use g_hash_table_steal()
It returns TRUE/FALSE, not the item you've stolen, so if you free that,
your X connections is gonna have a BadCursor.
2017-11-04 01:35:59 +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
e294f71555 x11: Redo cursor handling completely
Instead of creating a GdkX11Cursor, create GdkCursors. Cache the XCursor
in a hash table instead.

Also, make use of the new fallback mechanism for fallback code: Make
sure to provide cursors for the names that are guaranteed to exist, but
do not do bad attempts at displaying texture surfaces.
Black/White/transparent is not a replacement for those.
2017-11-04 00:07:13 +01:00
Benjamin Otte
d30d55be9e gdk: Make cursors instantiable
This way, backends can instantiate GdkCursor objects directly.

Do that for broadway to test that it indeed works.
2017-11-04 00:07:13 +01:00
Benjamin Otte
428547e14f gdk: Add gdk_cursor_hash() and gdk_cursor_equal()
This is so GDK backends can put cursors into hash tables and avoid
duplicates.
2017-11-04 00:07:13 +01:00
Benjamin Otte
6b2ea46a5f gdk: Add gdk_cursor_get_fallback()
There's no way to use it yet, but I want it to be available for
refactoring the backends.
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
0cad0caf7d broadway: Don't crash on startup 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
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
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
8aa68110bd x11: Remove gdk_x11_grab_server()
Luckily, this one is unused.
2017-11-02 12:47:50 +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
Benjamin Otte
d380cf114b x11: Remove outdated functions from API
We don't want generic APIs that do random stuff on the default X display.
2017-11-02 12:42:58 +01:00
Benjamin Otte
f33c20920b x11: Add API to query root window and screen from GdkDisplay 2017-11-02 12:42:16 +01:00