Commit Graph

11678 Commits

Author SHA1 Message Date
Matthias Clasen
3fc9de7539 offload: Make logging more compact
Use a format of

[XXX] SYMBOL DETAILS

where SYMBOL indicates the offloading status:
 🗙 - no offload
 ▲ - offload above, with background
 △ - offload above, no background
 ▼ - offload below, with background
 ▽ - offload below, no background
2024-04-24 22:01:56 -04:00
Matthias Clasen
492940205e Merge branch 'amolenaar/macos-fix-nsapp-shortcuts' into 'main'
macos: fix in-app native shortcuts (regression)

See merge request GNOME/gtk!7178
2024-04-25 01:35:59 +00:00
Arjan Molenaar
985e4906c8 macos: Add some docs for the different NSEvent getters 2024-04-24 23:49:37 +02:00
Matthias Clasen
a2854af325 macos: Respect the default-settings debug key
This makes our behavior more consistent across platforms.
The suggestion came up in discussion in #6545.
2024-04-23 07:52:25 -04:00
Arjan Molenaar
f004f14b89 macos: fix in-app native shortcuts (again)
Popping an event of the queue in the IMContext handler
prevents it from being forwarded to the NSApp, in case the
(key) event was not handled by IMContext.

So I reverted to a mix of the original (4.13) and new (4.14.1) behavior
for fetching events: NSEvent lookup for IMContext uses loose matching,
so it can work with rewritten events. When sending events to NSApp, only
we're checking for an exact match.

Now in-app keyboard shortcuts (e.g. Ctrl-F2) work from within text
fields again.
2024-04-23 08:57:09 +02:00
Matthias Clasen
2e0f411de9 Merge branch 'amolenaar/macos-fix-delayed-rendering' into 'main'
macos: Avoid repeatedly sending events back to macOS

See merge request GNOME/gtk!7158
2024-04-22 16:25:57 +00:00
Matthias Clasen
9f358ac655 Merge branch 'matthiasc/for-main' into 'main'
roaring: Fix some ubsan warnings

See merge request GNOME/gtk!7165
2024-04-22 15:52:04 +00:00
Arjan Molenaar
f81038e99a macos: Avoid repeatedly sending events back to macOS
in the old approach it was possible that one NSEvent was
sent to the underlying NSApp multiple times. This resulted in
those events being forwarded to our (glib) event queue again.

The visual result was that no screen updates were done. Under the hood
the application was very busy with passing events around.

By popping the events off of our event queue, we make sure they're sent
only once.
2024-04-22 15:51:12 +02:00
Alice Mikhaylenko
007e7c68dc wayland: Consistently handle enum type
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6649
2024-04-22 17:18:11 +04:00
Matthias Clasen
815df9a76a wayland: Fix an ubsan warning
dev_t requires 8-byte alignment, so we need to use memcpy.
2024-04-21 21:32:41 -04:00
Matthias Clasen
3bd97590a1 wayland: Tweak a debug message
We aren't drawing to subsurfaces.
2024-04-21 20:37:45 -04:00
Matthias Clasen
722a0fa36d wayland: Check subsurface backgrounds better
Do the same checks for background coordinates that we do for the
subsurface coordinates themselves: they must be integral in both
application and device pixels.
2024-04-21 20:33:29 -04:00
Matthias Clasen
b21708c5e4 offload: Consolidate logging a bit
Spew a bit less per-frame. Unfortunately, we still spew for
every frame, and fixing that would require more extensive
refactoring to centralize all logging in gskoffload.c
2024-04-21 20:18:38 -04:00
Matthias Clasen
b5fb584316 wayland: Use gdk_debug_message consistently
For debug messages, we should always use gdk_debug_message.
2024-04-21 19:41:49 -04:00
Matthias Clasen
c0caae0ff0 wayland: Use wl_compositor version 6
This gives us events for preferred_buffer_scale (which we ignore)
and preferred_buffer_transform (which we also currently ignore).
2024-04-21 19:27:58 -04:00
Matthias Clasen
4b0d17b332 wayland: Fix an offload cornercase
Treat textures with background as opaque for the purposes of
offloading.
2024-04-21 12:21:40 -04:00
Matthias Clasen
c1327e2c1b gdk: Deprecate public cursor theme setters
No need for this api, we've made the frontend setter private
for a reason.
2024-04-20 07:50:10 -04:00
Matthias Clasen
5f7cab4632 Add a new font rendering setting
Add a high-level setting that gives us more freedom to tweak
font rendering knobs according to our needs. It has a 'manual'
value that lets users continue to influence font rendering using
the low-level font-related settings as before.

Once the schemas have this, we can support setting this session-wide.
See https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/79

The initial implementation of 'automatic' font rendering is fairly
simplistic: if the monitor dpi is less than 200, prefer sharpness,
so turn on metrics hinting and slight hinting. If the monitor dpi
is at least 200, we both off.
2024-04-19 12:56:34 -04:00
Matthias Clasen
558db5a3a7 settings: Allow enums as settings
We can easily handle this, and it makes such settings appear
more natural, e.g. in the inspector.
2024-04-19 12:56:34 -04:00
Matthias Clasen
74a1c0916a Add a missing deprecation note
GdkVulkanContext is deprecated and only exposed in the api because
we need it as return type of the (deprecated)
gdk_surface_create_vulkan_context() API.
2024-04-18 12:49:18 -04:00
Matthias Clasen
8de5a94eb7 Merge branch 'fixwmhints' into 'main'
x11: Remove last_wmspec_check_time

Closes #6558

See merge request GNOME/gtk!7145
2024-04-17 15:31:26 +00:00
oreo639
ab33b56ec9 x11: Remove last_wmspec_check_time
In fetch_net_wm_check_window(), before updating the wmspec_check_window, a
check is performed to verify a 15s difference between last_wmspec_check_time
and the current monotonic time.

The comment suggests that this check is done to ensure that it doesn't check
for a new check window repeatedly over and over again. While that was the case
origionally, currently the last_wmspec_check_time only gets updated when
wmspec_check_window is set, which is already checked earlier, making the time
check useless.

This check causes issues on cold boots where gtk4 applications are not able
to obtain the wmspec_check_window until 15 seconds after boot, making gtk
unable to check for extended wm_hints during that time.

Fixes: #6558
2024-04-16 12:35:00 -07:00
Matthias Clasen
0e5f7601e4 Add some inline rgba functions
These are trivial enough to inline everywhere.
2024-04-15 22:57:01 -04:00
Matthias Clasen
40f26ea09b Drop another unwanted file 2024-04-15 21:40:52 -04:00
Matthias Clasen
00739718ab Drop unwanted files 2024-04-15 20:50:27 -04:00
Matthias Clasen
fbe000734a wayland: Refuse offloading when we can't
If we have a subsurface with background, but no single-pixel
buffer support, refuse to offload.
2024-04-15 19:53:46 -04:00
Matthias Clasen
0c67b367ac subsurface: Tweak the attach implementation
Do the backend call before changing the stacking order in the
frontend. This is necessary so the backend can look at the current
stacking order to determine if it will change.
2024-04-15 19:53:46 -04:00
Matthias Clasen
f75b4aac1d wayland: Minimize work for subsurfaces
Only commit things that have changed. In the ideal scenario, only
the texture changes from frame to frame, and all the sizing related
setup and the background stay the same, causing the least amount
of work in the compositor.
2024-04-15 19:53:46 -04:00
Matthias Clasen
d563d158c0 subsurface: Add gdk_subsurface_get_sibling
This was just a missing getter. The backend implementation will
use this information to determine whether stacking changes.
2024-04-15 19:53:46 -04:00
Matthias Clasen
a44598772d wayland: Use subsurface bounds for holes
When punching a hole into the opaque region, use the subsurface
bounds, which takes both the texture and the background into
account.
2024-04-15 19:53:46 -04:00
Matthias Clasen
933a0e5a98 subsurface: Some api revision and documentation
Rename things so they make more sense. The dest/source naming got
a bit unclear when we added background into the mix. Now we're going
for:

source_rect - the texture region to display
texture_rect - dimensions of the subsurface showing the texture
background_rect - dimensions of the background subsurface
bounds - union of texture_rect and background_rect

Also use this opportunity to add some api docs.
2024-04-15 19:53:46 -04:00
Matthias Clasen
3f9bdaa4c8 Add background to subsurfaces
Make it possible for subsurfaces to have a black background on a
secondary subsurface below the actual subsurface. Using a single-pixel
buffer for that background increases the changes that the compositor
will use direct scanout for the actual subsurface.

This changes the private subsurface API. All callers have been
updated to pass an empty background rect.
2024-04-15 19:53:46 -04:00
Robert Mader
a70998aa50 wayland: Support the single-pixel-buffer protocol
This just gets the manager object. It is not used yet.
2024-04-15 19:53:46 -04:00
Matthias Clasen
0fb1f44eec gdk: Add a debug flag to allow non-dmabuf offload
This is useful for debugging offloading without having to rely
on gstreamer giving us dmabufs. To use it, set

GDK_DEBUG=force-offload

in the environment.
2024-04-15 19:53:46 -04:00
Matthias Clasen
1c8b22cf05 subsurface: Cosmetics 2024-04-15 19:53:46 -04:00
Matthias Clasen
fc405f8882 wayland: Cosmetics
Don't clear the same pointer twice.
2024-04-13 17:22:42 -04:00
Robert Mader
9583195e96 gdk/wayland: Make the surface handle empty commits
In order to avoid some code duplication and ensure the Cairo and
Vulkan implementations behave like the GL one.
2024-04-12 17:04:54 +02:00
Philip Withnall
680dba6524
gdk: Fix a maybe-uninitialized warning
If there somehow end up being no `supported_versions`, `ctx` would end
up being dereferenced before being initialised. While I think that’s
unlikely, the compiler doesn’t know that, so let’s just initialise the
variable unconditionally.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-04-12 12:03:29 +01:00
Matthias Clasen
d1bb1d091c Merge branch 'gdk-build-dep-fix' into 'main'
build: Add a missing dependency

Closes #6618

See merge request GNOME/gtk!7127
2024-04-11 20:57:34 +00:00
Matthias Clasen
6510b876d1 build: Add a missing dependency
Add the generated gdk headers to the sources for all the backends,
to guarantee that they are generated before the library is used.

Fixes: #6618
2024-04-11 15:47:38 -04:00
Matthias Clasen
4889199b14 Merge branch 'glarea-dispose-fix' into 'main'
dmabuf texture: Survive multiple disposes

Closes #6623

See merge request GNOME/gtk!7131
2024-04-11 18:20:12 +00:00
Luca Bacci
2e15225446 Merge branch 'remove-work-arounds' into 'main'
GdkWin32: Remove some work arounds that are not needed anymore

Closes #6614

See merge request GNOME/gtk!7114
2024-04-11 17:03:08 +00:00
Matthias Clasen
ed072b4b5d dmabuf texture: Survive multiple disposes
dispose can be called more than once, so be safe for that.
2024-04-11 12:45:24 -04:00
Matthias Clasen
06e905f87d Merge branch 'gtk-wlmod' into 'main'
Meson: Use wayland module

See merge request GNOME/gtk!7126
2024-04-11 01:29:29 +00:00
Xavier Claessens
95a8def7c2 Meson: Use wayland module 2024-04-10 11:43:04 -04:00
Matthias Clasen
8068111c6e Merge branch 'fix-xi2-input-source-type-debug-msg' into 'main'
xi2: Fix incorrect input source type in Input debug message

Closes #6619

See merge request GNOME/gtk!7120
2024-04-10 00:45:14 +00:00
Matthias Clasen
aed4ced032 Merge branch 'broadway-port-2972-3130' into 'main'
[gtk4] gdk/broadway: Port !2972 and !3130 from gtk3

See merge request GNOME/gtk!4467
2024-04-10 00:12:28 +00:00
Matthias Clasen
a63e9d38fb gdk: Add private convenience api
Add a function to get the monitor resolution.

We may use this information in the future to make font rendering
decisions.
2024-04-09 19:13:34 -04:00
Hansem Ro
d90dc7f75e xi2: Fix incorrect input source type in Input debug message
This drops cursor and eraser source names to account for their removal
from GdkInputSource so that GDK_DEBUG=input debug message correctly
prints source type in X11 environment.

Fixes: c1d90273 ("gdk: Drop GDK_SOURCE_ERASER")
Fixes: 3285f52d ("gdk: Drop GDK_SOURCE_CURSOR")
Closes: #6619
2024-04-08 10:15:00 -07:00
Matthias Clasen
2b09f5ea1e dmabuf: Reshuffle docs slightly
Move related parts together, for easier understanding.
2024-04-07 13:03:13 -04:00