Commit graph

1848 commits

Author SHA1 Message Date
Dima Krasner
a9076f2a01 use the GTK+ 3 notebook header color as the default active title color 2023-11-28 21:55:33 +00:00
Brandon Nason
bad8f334ea Add omnipresent flag for views 2023-11-28 21:41:30 +00:00
John Lindgren
6b8c79748a xwayland: set _NET_WORKAREA property based on usable area
XWayland clients use the _NET_WORKAREA root window property to determine
how much of the screen is not covered by panels/docks. The property is
used for example by Qt to determine areas of the screen that popup menus
should not overlap (see QScreen::availableVirtualGeometry).

Depends on wlroots MR:
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4406

v2: prevent calling wlr_xwayland_set_workareas() too early
v3: fix segfault at exit (server->xwayland == NULL)
2023-11-27 22:08:43 +00:00
John Lindgren
5a2df57363 xwayland: prevent overriding maximized/fullscreen/tiled geometry
Fixes an issue where some XWayland views (example: xfce4-terminal)
do not end up with exactly the correct geometry when tiled.
2023-11-27 21:58:59 +00:00
Johan Malm
aab8061dee wlroots.wrap: set revision = 0.17 2023-11-27 21:01:53 +00:00
Consolatis
9eb7e69a04 Chase wlroots: use output commit event state
Chases: 5fb0007e0249388792f3772c30bfabf8d551dec0
output_event_commit: Remove committed and buffer
2023-11-27 21:01:53 +00:00
Consolatis
627179b277 Chase wlroots: drop KDE idle protocol
Chases: a289f812d62059d5aac92cbd374dcb7b03bb08a6
drop KDE idle protocol support
2023-11-27 21:01:53 +00:00
John Lindgren
96c85051ae Chase wlroots: add output to scene_output_layout explicitly
Chases: f5917f0247600b65edec1735234d00de57d577a8
scene_output_layout: make output adding explicit
2023-11-27 21:01:53 +00:00
Consolatis
ddc9047a67 Restore nested resize
Chases: 756ecf8ee9f1e75bc7b8297dc84f97c7d699174b
backend/wayland: use request_state when toplevel is resized

Chases: 3ef68a484243555b020200c6f95246d994932c3f
backend/x11: use request_state when window is resized

Ref: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2693

We now delay requested resolution changes by the backend until
the next frame event which causes us to render the new content
on the already enlarged buffer. Before this change, an empty
(black) buffer would have been shown instead before the next
frame event caused a new render of the actual contents.

Keep commiting the new state and then scheduling a frame event
would not help as due to the commit call it would still show an
empty buffer in the meantime.

Just modifying wlr_output->pending wouldn't work either because
wlr_scene_output_commit() *completely* ignores it (and it will
be removed in future wlroots commits). For this reason we move
to wlr_scene_output_build_state() directly because it allows us
to supply the current wlr_output->pending state and thus apply
any resolution change in lockstep with new rendering. Result:
No more flickering in the wayland backend and resizing is again
smooth as butter.

This prevents constant flicker while resizing
when running nested via the wayland backend.

For the X11 backend (can be tested via `WLR_BACKENDS=x11 labwc`),
it is still rather janky but at least doesn't cause endless self-
resizing anymore.
2023-11-27 21:01:53 +00:00
Consolatis
1626092639 Chase wlroots: xdg-decoration now references a toplevel
Chases: bdc34401ba8e4a59b3464c17fa5acf43ca417e57
xdg-decoration: store an xdg_toplevel instead of xdg_surface
2023-11-27 21:01:53 +00:00
Consolatis
5292504d4a Chase wlroots: Remove workaround for missing forward declares
Chases: 657ca2205ff4d5f70cf294d9b5720acf2eaf76b4
wlr_gamma_control: add missing forward declarations
2023-11-27 21:01:53 +00:00
John Lindgren
277f417d8b Chase wlroots: add options argument to wlr_scene_output_commit()
Chases: 214df8eda07d18b032abfcf525c8344e077c0c7e
scene_output: optionally record and report timings
2023-11-27 21:01:53 +00:00
John Lindgren
9c5266ac76 Chase wlroots: Use wlr_cursor_set_xcursor()
Chases: 18bafbfc57039e16d1dabd78b882b3d6477f76b5
xcursor-manager: drop wlr_xcursor_manager_set_cursor_image()
2023-11-27 21:01:53 +00:00
Consolatis
4d49c8250c Chase wlroots: Add workaround for missing forward declares
Chases 70c1a5724814d2f786f7d3a0e55a05f11af14029
gamma-control-v1: introduce set_gamma event
2023-11-27 21:01:53 +00:00
Christopher Snowhill
d7dc6e01b4 Chase wlroots: Unified mapping
Need to handle new unified mapping, where mapping is attached to the
wlr_surface objects instead of their parents. Also, most of them require
a new associate event for xsurface objects, their surface member will be
NULL before this event is received.

Refactored by jlindgren:
- add struct mappable
- unify map/unmap logic
2023-11-27 21:01:53 +00:00
Consolatis
bf576e97de CI: add libdisplay-info
This is a new dependency of wlroots.
2023-11-27 21:01:53 +00:00
John Lindgren
dc6bc43282 Chase wlroots: Pass version to wlr_compositor_create()
Chases: 0bb574239d3b164596677bf4cec371ff0671dc4f
compositor: pass version in wlr_compositor_create
2023-11-27 21:01:53 +00:00
John Lindgren
3e442785d3 CI: add libxcb-ewmh-dev for Debian (new wlroots dependency) 2023-11-27 21:01:53 +00:00
John Lindgren
404fabec92 Chase wlroots: wlr_scene_surface_from_buffer renamed
Chases: 7b32c25a4fbdcde4197a06c8e0ff638c54753bd7
wlr_scene: Rename wlr_scene_surface_from_buffer
2023-11-27 21:01:53 +00:00
John Lindgren
b5220a723e Chase wlroots: convert to try_from
Chases: 711a1a3ed42150fdbc716e80719d482006075f69
xdg-shell: convert to try_from

Chases: f9bd416d4156942ce3951a6c5cf9f81a3cf4a3dd
layer-shell-v1: convert to try_from

Chases: fbf5982e3838ee28b5345e98832f6956c402b225
xwayland/xwm: introduce wlr_xwayland_surface_try_from_wlr_surface()
2023-11-27 21:01:53 +00:00
Consolatis
d0b24f73d7 Chase wlroots: wlr_output_layout refactor
Chases 097ea84cda70a71ad8ea5940b3b3d277167424e5
output-layout: improve API
2023-11-27 21:01:53 +00:00
Consolatis
46e3e29e26 Chase wlroots: wlr_session refactor
Chases 41b7acbab78597e2eb0724e415ed94b910d113c1
backend: return wlr_session in wlr_backend_autocreate() call
2023-11-27 21:01:53 +00:00
Consolatis
fa849cc7e8 Chase wlroots: wlr_surface refactor
Chases 258bf9be1e44d8a2fb953d727ff4ffcf9ebd6503
compositor: drop wlr_surface.{sx,sy}
2023-11-27 21:01:53 +00:00
Consolatis
b4fc72b460 Chase wlroots: Layershell version
Chases 9f793d350379872aeee56ea5c476adfeedc8bc88
layer-shell-v1: specify version in constructor
2023-11-27 21:01:53 +00:00
Consolatis
5feda28f12 Chase wlroots: Update meson.build wlroots requirement to >= 0.17 2023-11-27 21:01:53 +00:00
Johan Malm
7af5f1d5ce build: bump version to 0.6.6 2023-11-25 21:14:12 +00:00
Johan Malm
b74011284a NEWS.md: update notes for 0.6.6 2023-11-25 21:14:12 +00:00
Johan Malm
49365b26d7 xwayland: assign view->surface earlier in map handler
...as it needs to be set before honouring xwayland_surface->fullscreen
because that calls desktop_update_top_layer_visiblity() which relies on
view->surface being set in view_is_focusable() since 13d0b14.

Fix bug introduced by PR #1237 which fails to hide the xfce4-panel (or
any other layer-shell client in the top layer) whilst gaming in
fullscreen. The bug can be observed with the following games:

- Alan Wake 2 (wine)
- Starfield (steam+proton)
- Cyberpunk (steam+proton)
- Quake 1 Remaster (steam-native)

Fixes: #661 (the last bit of it)

Reported-by: @ScarecrowDM
Helped-by: @Consolatis
2023-11-25 20:11:43 +00:00
Johan Malm
1b8e404c9c xwayland: do not re-set deocrations on unminimize
Reproduce issue by:

1. Run an XWayland client
2. ToggleDecorations twice to hide deco
3. Minimize/unminimize from panel
4. Observe that deco is back

Reported-by: @Consolatis
2023-11-21 22:08:59 +00:00
Consolatis
6c1ca61ee7 Keep xwayland stacking order in sync when switching workspaces
Until we expose the workspaces to xwayland we need a way to
ensure that xwayland views on the current workspace are always
stacked above xwayland views on other workspaces.

If we fail to do so, issues arise in scenarios where we change
the mouse focus but do not change the (xwayland) stacking order.

Reproducer:
- If followMouse is enabled, raiseOnFocus must be disabled
- Open at least two xwayland windows which allow scrolling
  (some X11 terminal with 'man man' for example)
- Switch to another workspace, open another xwayland window
  which allows scrolling and maximize it
- Switch back to the previous workspace with the two windows
- Move the mouse to the xwayland window that does *not* have
  focus
- Start scrolling
- All scroll events should end up on the maximized window on
  the other workspace

This patch fixes the issue by simply raising all windows from
the current workspace again in their original stacking order
when switching workspaces.

Reported-by: Domo via IRC (thanks!)
2023-11-21 22:31:05 +01:00
Consolatis
042215f856 common/array.h: add wl_array_for_each_reverse macro 2023-11-21 22:31:05 +01:00
Consolatis
4d679801ad src/view.c: add always_on_top criteria 2023-11-21 22:31:05 +01:00
Johan Malm
2734302fd2 keyboard: fix key repeat bug on surface focus change
The bug can be reproduced by using the following keybinds and then taking
the steps below with an XWayland client, for example xterm:

    <keybind key="C-S-h">
      <action name="GoToDesktop" to="left" wrap="yes"/>
    </keybind>
    <keybind key="C-S-l">
      <action name="GoToDesktop" to="right" wrap="yes"/>
    </keybind>

1. Press C-S-h
2. Press C-S-l
3. Observe llllllll.... in xterm

Store the key-state in `handle_keybind()` before any call to
`action_run()` as this may lead to `seat_focus()` which passes
'pressed-sent' keys to the new surface.

This partially reverts 7571c4b, which as a standalone commit was fine, but
when 'pressed_mods' were then included in 'bound' in 98bf316,
`key_state_store_pressed_keys_as_bound()` was again required in
`handle_keybind()` to ensure modifers are not passed as non-modifiers in
`wlr_seat_keyboard_notify_enter()` in `seat_focus()`
2023-11-18 14:17:25 +00:00
Johan Malm
ba76b26165 key-state.c: add logging for 'pressed-sent' 2023-11-18 14:17:25 +00:00
Johan Malm
57a753cfa0 NEWS.md: interim update for 0.6.6 2023-11-12 22:39:58 +00:00
Consolatis
13d0b14244 Update top layer visiblity on workspace switch
Fixes: #1158
2023-11-12 17:39:00 +00:00
John Lindgren
98bf316ee6 keyboard: include pressed modifiers in bound set
This prevents applications from seeing and handling the release event
for a modifier key that was part of a keybinding (e.g. Firefox displays
its menu bar for a lone Alt press + release).
2023-11-12 17:37:30 +00:00
John Lindgren
fe9491443c keyboard: remove exceptions from storing pressed keys
These exceptions were added to prevent certain keys (modifiers and
synthetic layout switch key-events) from disabling keybindings (due to
the "nr_pressed_keys > 1" check). That check no longer exists, so the
exceptions should no longer be necessary.

Partially reverts e77330bc3f and 3e2baa3f05.
2023-11-12 17:37:30 +00:00
John Lindgren
5a77a3ad51 keyboard: remove nr_pressed_keys == 1 restriction for keybindings
This restriction should be unnecessary now (see the previous commit for
details) and caused issues with keybindings not working on some systems
where irregular keypress events are received (e.g. XF86XK_WakeUp)
without an accompanying release event.

Kept separate from the previous commit for the sake of potential future
bisects.

Partially reverts e77330bc3f.
2023-11-12 17:37:30 +00:00
John Lindgren
7571c4bed3 keyboard: avoid stuck keys due to keybindings (alternate approach)
Before commit e77330bc3f, there were issues with keys becoming "stuck"
if other keys were pressed at the time a keybinding was matched, because
those other keys were included in the "bound" set and the release events
were incorrectly eaten by labwc.

Commit e77330bc3f solved that issue with the "big hammer" approach of
preventing keybindings from working at all if other keys were pressed:

        if (key_state_nr_pressed_keys() > 1) {
                return false;
        }

This is an alternate approach to solving the original problem, by (1)
not including those other keys in the "bound" set and (2) making sure we
always forward release events for un-bound keys to clients (even if a
menu or OSD is displayed).

Details:

- Since we only ever want to store the single matched keycode as bound,
  key_state_store_pressed_keys_as_bound() doesn't really make sense in
  the plural, so rename it to key_state_store_pressed_key_as_bound() and
  pass in the keycode.

- The calls to key_state_store_pressed_keys_as_bound() within
  handle_keybinding() appear to be redundant since it is also called
  from the parent function (handle_compositor_keybindings()). So remove
  these calls.

- Finally, rework the logic for handling key-release events so that we
  always forward release events for keys not in the "bound" set.

This PR does not remove the "key_state_nr_pressed_keys() > 1" check, and
because of that should not result in any functional change. It should
however make it possible to relax or remove that check in future.
2023-11-12 17:37:30 +00:00
Jan Beich
0bd265600e CI: avoid heavy dependency in FreeBSD job
Not testing runtime yet, so disable Mesa drivers.
2023-11-12 02:59:11 +01:00
Jan Beich
00ec29c834 CI: run FreeBSD job on Ubuntu 2023-11-12 02:59:11 +01:00
Johan Malm
dcc10ba81b keyboard: fix shifted keystroke delay
Remove wlr_seat_set_keyboard() from `keyboard_modifiers_notify()`
but leave it in `keyboard_key_notify()`

Fixes regression introduced in 984aeb0

Reported-by: @jlindgren90

Fixes: #1238
2023-11-11 20:20:29 -05:00
Johan Malm
368ede7460 window-rules: add fixedPosition property
...to address regression introduced by 57075ce and enables panel/desktop
clients which rely on window rules to remain in the same position when
the usable-area changes (normally because an exclusive layer-shell
clients is started/finished).

Also disallows interactive move/resize, for example by alt +
mouse-press.

Fixes: #1235
2023-11-10 21:46:15 +01:00
tokyo4j
9a8a2905ad interactive: Make window snapping with mouse more intuitive
1. Prevent window snapping triggered by mouse from moving the window
 into the adjacent output.
2. Make the coordinates used to check whether window snapping is
 triggered relative to the output the cursor is at, not the output the
 view is belonging to. This allows users to grab a tiled window and move
 it into another output or tile it again in another output in a single
 drag.
2023-11-10 19:41:36 +00:00
Johan Malm
29a228674b Add unfocus action
...to enable unfocusing currently focused window on desktop click.

Works with:

    <mouse>
      <default />
      <context name="Root">
        <mousebind button="Left" action="Press">
          <action name="Unfocus" />
        </mousebind>
      </context>
    </mouse>

Fixes: #1230
2023-11-07 21:16:33 +00:00
John Lindgren
d2bcb94bae xdg: try to handle missing set_window_geometry with Qt apps
Qt applications occasionally fail to call set_window_geometry after a
configure request, but do correctly update the actual surface extent.
This results in a mismatch between the window decorations (which follow
the logical geometry) and the visual size of the client area. As a
workaround, try to detect this case and ignore the out-of-date window
geometry.

Fixes: #1194
2023-11-06 20:43:22 +01:00
John Lindgren
57075ce864 view: ensure that floating views don't overlap top panels
The top_left_edge_boundary_check() function in xwayland.c ensures that
views trying to position themselves at 0,0 don't end up with a titlebar
offscreen. However, it doesn't take into account the usable area and
thus these views can still end up overlapping a top panel.

Also, there is no good reason for top_left_edge_boundary_check() to be
xwayland-specific. This logic should really be part of
view_adjust_for_layout_change().

To fix all this, add a new view_adjust_floating_geometry() function,
which replaces the existing similar (and duplicated) logic in
view_apply_natural_geometry() and view_adjust_for_layout_change().

view_adjust_for_layout_change() is already being called from xwayland's
set_initial_position(), so top_left_edge_boundary_check() is now
redundant and can just be deleted.

Lightly tested with waybar and feh --geometry 640x480+0+0. The feh
window is now correctly positioned below waybar, even if started before
waybar (in that case, the feh window is moved when waybar starts).
2023-11-05 15:03:13 +00:00
Consolatis
984aeb0b0b keyboard: allow applying keyboard layout per window
Fixes #1076

It can be enabled with a config like

~/.config/labwc/rc.xml:
<keyboard layoutScope="window">

~/.config/labwc/environment:
XKB_DEFAULT_LAYOUT=de,us
XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle,grp_led:scroll

With a configuration like this each window should now remember
the active keyboard layout when switching between windows.

By default, the keyboard layout keeps being a global state.
2023-11-04 07:58:43 +00:00
Johan Malm
f1c2664ad1 NEWS.md: interim update for 0.6.6 2023-11-02 21:49:18 +00:00