Commit Graph

10737 Commits

Author SHA1 Message Date
Po Lu
e967dfed2d
Treat XKB_MOD_NAME_LOGO as super key 2022-10-06 11:19:31 +04:00
Matthias Clasen
8607312fef gdk: Cosmetics
Add a define for each renderer.
2022-10-05 23:01:28 -04:00
Jonas Ådahl
b3a3a6ceb1 toplevel-size: Report zero bounds as infinite
Empty/zero bounds are sent by the Wayland compositor if there are no
valid bounds to report, e.g. if there are no connected monitors. Report
this to GTK, which uses this to clamp calculated sizes, as INT_MAX, so
that clamping isn't done until there are actual valid bounds to clamp
to.

This fixes clients sometimes shrinking to their minimum size during
hotplugs or after having suspended the session.
2022-09-30 09:31:40 +02:00
Jonas Ådahl
148c133674 surface/wayland: Handle no current monitor when calculating bounds
We shouldn't assume there is always a monitor to derive bounds from.
If there is no monitor, pass empty bounds, as this matches what
xdg_toplevel.configure_bounds do in this case.
2022-09-30 09:31:40 +02:00
Matthias Clasen
0c02573c47 Add 4.10 version macros 2022-09-28 13:30:01 -04:00
Matthias Clasen
dd7cd6ffdd Add more names to sources
This helps with identifying things in sysprof logs,
and while debugging.
2022-09-28 12:37:21 -04:00
Matthias Clasen
5f469d8903 Merge branch 'broadway-device-query-state-fix' into 'main'
GTK4 gdk/broadway: correct gdk_broadway_device_query_state() to return pointer coordinates relative to the upper left corner of surface

See merge request GNOME/gtk!5053
2022-09-28 01:38:45 +00:00
Luca Bacci
e2219858ae GdkWin32: Fix subclassing for GdkWin32Clipdrop
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5207
2022-09-26 14:34:24 +02:00
Matthias Clasen
455eefa854 gdk: Use gnome.mkenums_simple
This lets us avoid template files, and works just as well.
2022-09-24 21:22:53 -04:00
Matthias Clasen
bc661a8ed5 gdk: Rename gdkpixbuf-drawable.c
There is nothing particularly specific to drawables
in there (and we don't have that concept anymore),
so just name the source file to match the header.
Easier for everybody.
2022-09-24 10:03:37 -04:00
Matthias Clasen
9ff549799d gdk: Tweaks to keyname handling
Rename the private header to follow our naming
conventions, and drop the extra gdkkeys.c file.
2022-09-24 10:03:37 -04:00
Matthias Clasen
4aabc45685 Drop gdkintl.h
This header was merely including gi18n-lib.h.
Just do that directly.
2022-09-23 23:33:42 -04:00
Matthias Clasen
a8af7caae1 Rename gdk-private.h to gdkprivate.h
The extra - does not add any value.
2022-09-23 23:23:27 -04:00
Matthias Clasen
7d2c296357 Rename gdkconstructor.h to gdkconstructorprivate.h
This is the naming convention for private headers.
2022-09-23 23:14:08 -04:00
Matthias Clasen
c24a69549d Rename gdkdebug.h to gdkdebugprivate.h
This is the naming convention for private headers.
2022-09-23 23:12:01 -04:00
Matthias Clasen
61a51dea7b gdk: Dissolve gdk-autocleanup.h
Move the autocleanup declarations into their
respective headers.

While we are at it, correct the autocleanup
declaration for GdkEvent to use gdk_event_unref,
not g_object_unref. Oops
2022-09-23 19:49:58 -04:00
Matthias Clasen
f33f55bcbb gtk: Use the new debug macros 2022-09-23 18:12:39 -04:00
Matthias Clasen
bc159207bd gdk: Drop old debug macros
Drop the old GDK_NOTE() and GDK_DISPLAY_NOTE()
macros from gdkdebug.h. Reintroduce them in the
win32 backend, where they are still used.
2022-09-23 18:11:48 -04:00
Matthias Clasen
1f166ae071 macos: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
ce4c2154f4 x11: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
71fedee85d wayland: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
90c2b548e5 broadway: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
1d48f96fc5 gdk: Use the new debug macros 2022-09-23 18:11:48 -04:00
Matthias Clasen
10255eee72 Introduce new debug macros
Introduce GDK_DISPLAY_DEBUG() and GDK_DEBUG() and
the helper function gdk_debug_message(). This is
meant to clean up the mess of our current debug
statements which wildly mix g_message, g_print
and g_printerr.
2022-09-23 18:11:48 -04:00
Matthias Clasen
c7a7e550dc Only print supported debug flags
It is a bit disorienting to print a lot of unavailable
debug flags, with some working ones mixed in. Just show
the ones that work.
2022-09-21 21:51:58 -04:00
Matthias Clasen
55ab99cb98 Make GL flavor flags always available
No need to restrict this to debug builds.
2022-09-21 21:29:34 -04:00
Matthias Clasen
f50b0a0bcb Make the gl-debug debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:17:16 -04:00
Matthias Clasen
01054c9c79 Make the gl-gles debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:12:22 -04:00
Matthias Clasen
8bd3ec2ba1 Make the gl-legacy debug flag always available
No need to restrict this to debug builds.
2022-09-21 21:09:08 -04:00
Matthias Clasen
e08a9ea9ad Drop the gl-texture-rect debug flag
This was not doing anything.
2022-09-21 21:05:25 -04:00
Matthias Clasen
1987398ec5 Drop the software-gl debug flag
This was not doing anything.
2022-09-21 21:03:40 -04:00
Matthias Clasen
fa0fc9acb8 Make the gl-disable flag always available
No need to restrict this to debug builds.
2022-09-21 20:57:22 -04:00
Matthias Clasen
fa1c461c13 Make the portals debug flag always available
No need to restrict this to debug builds.
2022-09-21 20:55:46 -04:00
Matthias Clasen
a99b05525d Make the nograbs flag always available
No need to restrict this to debug builds.
2022-09-21 20:53:46 -04:00
Matthias Clasen
a337b21a4f Make vulkan-disable always available
There is no need to restrict this to debug builds.
2022-09-21 20:51:35 -04:00
Matthias Clasen
1b96828667 Make vulkan-validate always available
There is no need to restrict this debug builds.
2022-09-21 20:49:53 -04:00
Matthias Clasen
7785c18c56 Fix high-depth handling
We mark this flag as always available, but we
were only checking it in debug builds.
2022-09-21 20:47:26 -04:00
Matthias Clasen
183709c522 Fix default-settings handling
This is meant to be always available, but we
were checking for debug in one place.
2022-09-21 20:45:43 -04:00
Maxim Zakharov
2acd10d7b0 gdk/broadway: correct gdk_broadway_device_query_state() to return pointer
coordinates relative to the upper left corner of surface
2022-09-21 15:42:40 +10:00
Simon McVittie
79285bd63e gdkevents: Don't ignore modifiers that are not currently active
The X11 backend can mark modifiers like Shift as consumed even if they
aren't actually active, which seems to be something to do with making
shortcuts like `<Control><Shift>plus` and `<Control>plus` work as
intended regardless of whether the plus symbol is obtained by pressing
Shift and a key (like `+/=` on American, British or French keyboards)
or not (like `*/+` on German keyboards).

However, this can go badly wrong when the modifier is *not* pressed.
For example, terminals normally have separate bindings for `<Control>c`
(send SIGINT) and `<Control><Shift>c` (copy). If we disregard the
consumed modifiers completely, when the X11 backend marks Shift as
consumed, pressing Ctrl+c would send SIGINT *and* copy to the clipboard,
which is not what was intended.

By masking out the members of `consumed` that are not in `state`, we
get the same interpretation for X11 and Wayland, and ensure that
keyboard shortcuts that explicitly mention Shift can only be triggered
while holding Shift. It continues to be possible to trigger keyboard
shortcuts that do not explicitly mention Shift (such as `<Control>plus`)
while holding Shift, if the backend reports Shift as having been
consumed in order to generate the plus keysym.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/5095
Bug-Debian: https://bugs.debian.org/1016927
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-09-17 19:40:53 +01:00
Matthias Clasen
65adcec82f Merge branch 'detect-stylus' into 'main'
Recognize "stylus" devices as GDK_SOURCE_PEN

Closes #4394

See merge request GNOME/gtk!4776
2022-09-16 12:12:37 +00:00
Matthias Clasen
32f55a74b0 portal: Use the right mimetype for file transfers
The filetransfer protocol says to use
application/vnd.portal.filetransfer, but I used
application/vnd.portal.files when I implemented the
protocol. Oops.

This commit dds the correct mimetype, but we still
support the old one to preserve interoperatibility
with existing flatpaks using GTK 4.6.

Fixes: #5182
2022-09-15 15:18:17 -04:00
Matthias Clasen
e16414b3ac Handle absence of portals
When the documents portal is not on the bus,
we still get an (unowned) proxy, and we need
to handle that situation.
2022-09-07 08:45:31 -04:00
Matthias Clasen
2e42786091 portals: Fix FileTransfer portal calls
We were not passing the right arguments to
the AddFiles call, causing the file transfer
to fail.
2022-09-07 06:47:02 -04:00
Matthias Clasen
b756aa0764 Make the file transfer portal setup sync again
We need to register the portal mime types before
the others to prefer them, doing this call async
messes up that ordering.

This is effectively reverting 69fb3648b2
2022-09-07 06:45:03 -04:00
Matthias Clasen
9654fd451f Stop recursion in registering serializers
This was probably unintentional, and messes up
the ordering of our registration.
2022-09-06 23:35:48 -04:00
Robert Mader
06a51b6ca6 wayland/display: Remove duplicate update_scale() call
`apply_monitor_change()` already calls `update_scale()`.
Note that this only affects old compositor versions (see
`should_update_monitor()`) so it's just a minor cleanup.
2022-09-03 00:53:02 +02:00
Christian Hergert
f5488bb4b2 gdk: fix typo in frame clock docs 2022-09-01 12:16:10 -07:00
Matthias Clasen
137af44f81 Merge branch 'font-chooser-feature-work' into 'main'
fontchooser: Handle font features better

See merge request GNOME/gtk!4984
2022-08-26 22:10:52 +00:00
Matthias Clasen
2017f3debe Some strdup avoidance 2022-08-25 14:33:30 -04:00