Commit Graph

47 Commits

Author SHA1 Message Date
Bartosz Taudul
bf86eba59c Rescale scale to have 120 as a unit. 2024-03-24 00:02:13 +01:00
Bartosz Taudul
16554ed2ed Handle wayland window resizes the right way. 2024-03-23 23:57:08 +01:00
Bartosz Taudul
aa4878bb8e Bind viewporter. 2024-03-23 22:27:49 +01:00
Bartosz Taudul
2bfa540656 Bind fractional scale manager. 2024-03-23 22:27:48 +01:00
Bartosz Taudul
bde0c63006 Generate Wayland protocol sources. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
776b08f2e0 Split core server files from the UI. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
c673056dd4 Prevent window resizes on DPI change. 2024-03-16 01:13:09 +01:00
Bartosz Taudul
4fbef01729 Trigger redraw when DPI changes.
Previously the wayland surface was not updated, because there were no
surface commits performed due to power saving routines.
2024-03-16 00:57:55 +01:00
Bartosz Taudul
bdfcc5b814 Add missing ImGui renderer shutdown to the Wayland backend. 2024-03-01 22:11:30 +01:00
Bartosz Taudul
ea0471f9d0 Fix wl_surface v6 listener. 2024-02-28 13:30:59 +01:00
Ivan Molodetskikh
fcdc96748e wayland: Use preferred_buffer_scale when available
On wl_compositor >= 6 we bind v6 and use preferred_buffer_scale.
Otherwise we bind 4 and do as before.

No other changes are needed for the version bump as Tracy doesn't use
wl_surface_attach() with nonzero coordinates.
2024-01-24 12:43:42 +04:00
Ivan Molodetskikh
16434f116c Add a way for Backend to signal scale changes
On Wayland the scale now changes to the correct value as the Tracy
window is moved across monitors.

If the scale is overridden from environment, it does not change, just
like before.
2024-01-24 12:34:23 +04:00
Ivan Molodetskikh
bf3bd28bfa wayland: Keep track of entered outputs for scale
Wayland kindly informs us which outputs the surface is on, to be used
for scale computation (at least on wl_compositor < 6). On mixed DPI
setups this fixes Tracy potentially using a higher scale than the output
it's displayed on.

However, as is, this commit results in Tracy always using scale 1,
because at the point of backend creation (which is when the scale is
queried) the surface is not yet displayed on any outputs, so a scale of
1 is assumed.
2024-01-24 12:19:52 +04:00
Ian Douglas Scott
8fe6c39bb5 wayland: Fix use of xdg-decoration protocol
`zxdg_toplevel_decoration_v1` isn't a global, so the code handling it as
one wasn't doing anything. Instead,
`zxdg_decoration_manager_v1_get_toplevel_decoration` returns it.

This fixes the behavior for compositors that support server-side
decoration, but do not default to it until explicitly requested by the
client.
2023-10-09 14:32:42 -07:00
Bartosz Taudul
c57b8994f6 Reduce required version of wl_seat protocol to 5.
The latest wl_seat protocol version is 9, but the last addition was made
to it in version 5. Wayland is stupid.
2023-05-25 18:48:45 +02:00
Bartosz Taudul
a0221c8660 Pass function objects through const references. 2023-04-16 16:44:18 +02:00
Bartosz Taudul
6e70b7c20b Push keyboard modifiers to ImGui. 2022-12-22 17:48:14 +01:00
Bartosz Taudul
797d5df850 Push key events to ImGui. 2022-12-22 17:39:30 +01:00
Bartosz Taudul
dff2a6d6c2 Implement XKB text compositing. 2022-12-20 22:19:45 +01:00
Bartosz Taudul
b7affdd92d Create XKB compose table/state. 2022-12-20 21:55:31 +01:00
Bartosz Taudul
0831b3f301 Push focus events to ImGui. 2022-12-20 17:11:15 +01:00
Bartosz Taudul
170a961d8d Tweak mouse wheel behavior on Wayland. 2022-12-20 16:54:28 +01:00
Bartosz Taudul
aa0e899573 Initialize XKB state. 2022-12-20 00:22:27 +01:00
Bartosz Taudul
7106b0c5ef Hook no-op keyboard handling. 2022-12-19 23:46:08 +01:00
Bartosz Taudul
3b58f5596d Detect precise (touchpad) scroll events.
Currently the wheel axis Y change has little impact, as the zoom in/out logic
assumes wheel events are discrete.
2022-12-19 21:26:59 +01:00
Bartosz Taudul
ac87b05dcb Fix scroll events direction on Wayland. 2022-12-19 21:11:53 +01:00
Bartosz Taudul
7f00ae8c83 Fix mouse buttons order on Wayland. 2022-12-19 21:10:55 +01:00
Bartosz Taudul
b80ede3ec6 Limit time delta to 0.1s. 2022-12-11 18:01:32 +01:00
Bartosz Taudul
9e6214350c Support Hi-DPI mouse cursor. 2022-12-11 17:50:05 +01:00
Bartosz Taudul
1f4562e51d Support Hi-DPI. 2022-12-11 17:43:41 +01:00
Bartosz Taudul
63ba9cccf2 Track max output scale. 2022-12-11 17:29:28 +01:00
Bartosz Taudul
3d42732795 Track window maximized state. 2022-12-11 16:45:35 +01:00
Bartosz Taudul
462d8103aa Mark activity on window XDG surface reconfiguration.
This happens for example when the window is resized, or maximized.
2022-12-04 21:12:50 +01:00
Bartosz Taudul
12a109d303 Use XDG decoration protocol. 2022-12-04 21:12:50 +01:00
Bartosz Taudul
e1395f5a53 Rename surfaceListener to include xdg part. 2022-11-10 00:02:20 +01:00
Bartosz Taudul
d26ae1fbb5 Manage list of outputs. 2022-11-10 00:00:50 +01:00
Bartosz Taudul
8b9246e312 Add global remove callback. 2022-11-09 23:11:45 +01:00
Bartosz Taudul
53d54092b0 Implement attention requests. 2022-11-08 01:36:45 +01:00
Bartosz Taudul
1173cbc639 Move wayland protocol to a subdirectory. 2022-11-08 01:04:23 +01:00
Bartosz Taudul
e6f74c04d6 Wayland cursor handling is fucking stupid. 2022-11-08 00:31:57 +01:00
Bartosz Taudul
e227cfe100 Process pointer events. 2022-11-07 21:46:17 +01:00
Bartosz Taudul
4f7fba1fed Hook seat. 2022-11-07 01:20:48 +01:00
Bartosz Taudul
9645998a97 Set app id. 2022-11-06 01:33:15 +01:00
Bartosz Taudul
1ccc0c39ea Delay toplevel creation until after OpenGL initialization. 2022-11-06 01:14:56 +01:00
Bartosz Taudul
4d74968515 Wait for xdg_surface to be configured.
Some compositors require configuration event to happen before getting
toplevel.
2022-11-06 01:01:07 +01:00
Bartosz Taudul
a2f774dc20 Downgrade wl_compositor protocol to version 4.
Some compositors do not implement protocol in version 5.
2022-11-06 00:43:09 +01:00
Bartosz Taudul
ce797d82d5 Add minimal wayland backend. 2022-11-05 22:41:54 +01:00