Commit Graph

10930 Commits

Author SHA1 Message Date
Benjamin Otte
7fff188557 wayland: Don't crash during DND with Cairo renderer
Attaching buffers with offsets is forbidden now and nobody
checked the Cairo renderer.
2023-03-07 20:16:59 -05:00
William Roy
aaeec84d75 Fix compile_resources present source directory
In certain scenarios, address the issue where gnome.compile_resources 
fails to transmit the present source directory. This is most notably 
visible with MSBuild.
2023-03-07 21:59:50 +00:00
Jonas Ådahl
4500fa633b wayland: Destroy xdg_surface after role
The split-up of gdksurface-wayland.c introduced a protocol violation
when it didn't make sure xdg_surface was destroyed after the role
objects (xdg_popup / xdg_toplevel). Fix that.

Fixes: 2a463baed0 ("wayland: Rearrange the surface code")
2023-03-05 20:55:41 +01:00
Benjamin Otte
98eac8ac83 Fixes for gdk_memory_texture_new_subtexture checks
There were several mistakes here.
2023-03-03 11:24:46 -06:00
Carlos Garnacho
ae94417f80 gdk/x11: Also grab keyboard during XDnD grabs
The drag source must handle events and messaging, this also
includes keyboard handling for accessibility and cancellation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5604
2023-02-18 23:02:22 +01:00
Jonas Ådahl
53c3f497f1 wayland: Clean up some dead code 2023-02-17 12:03:58 +01:00
Jonas Ådahl
3183a21347 wayland/glcontext: Don't call wl_surface.offset on old objects
The availability of wl_surface.offset depends on the compositor, so we
can't call it unconditionally. Add a version check to so we only call
offset if we know we won't raise a protocol error.

Fixes: 0eb791eaaa ("Make mask nodes more versatile")
2023-02-17 12:03:27 +01:00
Matthias Clasen
9a539cec57 Merge branch 'mask-modes' into 'main'
Make mask nodes more versatile

See merge request GNOME/gtk!5521
2023-02-15 00:57:17 +00:00
Matthias Clasen
0eb791eaaa Make mask nodes more versatile
Add a GskMaskMode enumeration and implement it
in the GL and cairo renderers.
2023-02-14 19:07:01 -05:00
Benjamin Otte
cca5de3c7f memorytexture: Export less private API
It's not needed anymore with GdkTextureDownloader now.
2023-02-15 00:39:18 +01:00
Benjamin Otte
c9f54ca371 texture: Export gdk_texture_get_format()
The API docs outline why quite well.

This should make it possible to do saving of textures to image files
without any private API with the same featureset that GTK uses.

Also remove the gsktextureprivate.h include where
gdk_texture_get_format() was the only reason for it.
2023-02-15 00:39:18 +01:00
Benjamin Otte
ce0123ea58 docs: Link from gdk_texture_download() to GdkTextureDownloader 2023-02-15 00:39:18 +01:00
Benjamin Otte
b30af72125 tiff: Use GdkTexureDownloader when saving 2023-02-15 00:39:18 +01:00
Benjamin Otte
eb45b8083a png: Use GdkTexureDownloader when saving 2023-02-15 00:39:18 +01:00
Benjamin Otte
f05d801e28 jpeg: Use GdkTexureDownloader when saving 2023-02-15 00:39:18 +01:00
Benjamin Otte
4afec951c7 pixbuf: Use GdkTextureDownloader when downloading pixbufs 2023-02-15 00:39:18 +01:00
Benjamin Otte
51ed1442a2 gdk: Add GdkTextureDownloader
It's the new object that allows more control about accessing texture
data.
2023-02-15 00:39:18 +01:00
Benjamin Otte
01ff6c1c22 memorytexture: Use right size for GBytes
The GBytes were created with the wrong size.

Nobody seems to have looked at it.
2023-02-14 23:42:17 +01:00
Jonas Ådahl
b2a2bf819d wayland/launch-context: Use dispatch helper
Otherwise we risk a busy loop if e.g. the pipe broke.
2023-02-11 23:14:53 +01:00
Jonas Ådahl
dd9433b50e wayland: Add event queue dispatch helper
Dispatch failing should always fatal; use a helper to centralize the
error handling everywhere.
2023-02-11 23:13:39 +01:00
Matthias Clasen
04c3af537c Merge branch 'wip/handle-more-wl-dispatch-failures' into 'main'
wayland: Handle dispatch failing in a couple of more places

See merge request GNOME/gtk!5495
2023-02-11 19:56:45 +00:00
Matthias Clasen
d497e721c9 gdkevents.c: Fix up folding
The modeline was lost at some point,
and superfluous spacing inserted.
2023-02-11 08:59:51 -05:00
Jonas Ådahl
a7fb9a6865 wayland: Handle dispatch failing in a couple of more places
Without doing this, we'll end up with risking GTK processes sitting
eating 100% CPU instead of just exit(1):ing.
2023-02-11 11:42:21 +01:00
Carlos Garnacho
824e983372 gdk/x11: Reset all scroll valuators on enter
We no longer need to make much distinction between multiple logical
devices, plus it breaks esp. with the Xwayland input device distribution.
Just iterate across all devices and reset their scroll valuators.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160
2023-02-04 13:13:19 +01:00
Carlos Garnacho
4005eb8fe8 gdk/wayland: Rename gdkkeys-wayland.c file
Since it contains the GdkKeymap implementation, give it a more
obvious name.
2023-02-03 16:15:34 +01:00
Carlos Garnacho
1d4ceac2c5 gdk/wayland: "Split" GdkWaylandDevice implementation out
This is a bit spaghetti right now, since seats and devices were
heavily entangled there are a number of crossed private API calls that
should ideally not be there.

Let this be a first step, so more bits may move from the seat
implementation to devices.
2023-02-03 16:15:34 +01:00
Carlos Garnacho
a5246a6856 gdk/wayland: Split GdkDevicePad wayland implementation
This now lives in its own C file.
2023-02-03 16:08:07 +01:00
Carlos Garnacho
af00beb772 gdk/wayland: Move struct declarations to header
These will be used from outside the main file, after we are
done splitting it.
2023-02-03 16:00:01 +01:00
Carlos Garnacho
e5cd9354d5 gdk/wayland: Move GdkWaylandDevice data to private struct
Before splitting this object, avoid leaking details in its struct.
2023-02-03 15:58:11 +01:00
Carlos Garnacho
6426ab7466 gdk/wayland: Rename gdkdevice-wayland.c to gdkseat-wayland.c
This file, event though a clump of input-y objects, has more of
seats than anything else. Rename it so that we can start splitting
these objects out of it.
2023-02-03 15:58:11 +01:00
Matthias Clasen
50998b0ee9 Merge branch 'drag-icon-robustness' into 'main'
dragicon: Handle files without info

See merge request GNOME/gtk!5460
2023-02-03 13:19:26 +00:00
Carlos Garnacho
d228bae365 Merge branch 'drag-button-issue' into 'main'
Fix button mask calculation for Wayland

Closes #5561

See merge request GNOME/gtk!5468
2023-02-03 09:28:01 +00:00
Benjamin Otte
c17049c6d1 Merge branch 'wip/otte/gl-is-current' into 'main'
gdk: Add private GLContext::is_current() check

Closes #5392

See merge request GNOME/gtk!5463
2023-02-02 21:56:32 +00:00
Arjan Molenaar
f000baf0d6
wayland: Fix button mask for button 2 and 3
Wayland and GTK order mouse button 2 and 3 differently.

Fixes #5561.
2023-02-02 21:48:58 +01:00
Matthias Clasen
8911ed5d9b Merge branch 'monitor-description' into 'main'
Add GdkMonitor::description

See merge request GNOME/gtk!5466
2023-02-02 14:12:23 +00:00
Carlos Garnacho
7ad74ad6c3 gdk/wayland: Deprecate GdkDisplay windowing-specific for startup IDs
This is currently just used as a convenience storage of the startup ID
between the GtkApplication and the GtkWindow (after it's ready to notify
on it).

This could be untangled in the GTK layers so there is no involvement
from GDK in keeping the startup ID around, in the mean time just deprecate
these gdk_wayland* API calls.
2023-02-02 12:50:59 +01:00
Matthias Clasen
4e62350232 wayland: Set up monitor descriptions
We get this information in the xdg_output protocol.
2023-02-02 12:32:28 +01:00
Matthias Clasen
2c883a70e2 Add GdkMonitor::description
This is the right string to when showing
monitors in the UI.
2023-02-02 12:32:28 +01:00
Matthias Clasen
3dfeb2fd37 monitor: Document connector names better 2023-02-02 12:32:28 +01:00
Matthias Clasen
12057c8a30 gltexture: Small refactoring
We do this in two places, so factor out
the dropping of GL resources into a helper.
2023-02-02 10:01:36 +01:00
Matthias Clasen
8796950651 Deprecate more startup-notification API 2023-02-02 08:30:32 +01:00
Benjamin Otte
c6cef6db52 gdk: Add private GLContext::is_current() check
... and use this check in gdk_gl_context_make_current() and
gdk_gl_context_get_current() to make sure the context really is still
current.

The context no longer being current can happen when external GL
implementations make their own contexts current in the same threads GDK
contexts are used in.
And that can happen for example by WebKit.

Theoretically, this should also allow external EGL code to run in X11
applications when GDK chooses to use GLX, but I didn't try it.

Fixes #5392
2023-02-02 04:23:51 +01:00
Benjamin Otte
fdea27c04d win32: Remove unused variable 2023-02-02 04:23:51 +01:00
Matthias Clasen
6655177a0b Cosmetics 2023-02-01 18:38:22 +01:00
Matthias Clasen
1cb621633c gltexture: Use the right context
When checking characteristics of the context
for downloading, we were using self->context,
even though we are using a possibly different
context for downloading.

Pass the right context along and use it.
2023-02-01 11:32:07 +01:00
Matthias Clasen
92612c2265 filetransfer: Be more careful around files
File may not have paths, and we should handle
that without incident. While we are at it, add
some logging so GDK_DEBUG=dnd gives us enough
output to see what is going on.
2023-01-30 14:03:13 -05:00
Carlos Garnacho
7f8acf960b gdk/broadway: Add deprecation guards around gdk_display_put_event()
This went missing.
2023-01-27 19:59:36 +01:00
Matthias Clasen
c24ba58acb Merge branch 'broadway-modal-hint' into 'main'
[GTK4] gdk/broadway: Implements modal hint for Broadway surface

See merge request GNOME/gtk!4428
2023-01-26 02:44:54 +00:00
Arjan Molenaar
6757a1b409 macos: Propagate events for child surfaces
Before, popup windows did not respond to mouse clicks.
This change fixes that.

Fixes #5528.
2023-01-24 09:07:33 +01:00
Maxim Zakharov
115738dd2f remove unused variable 2023-01-24 11:41:27 +11:00