Commit graph

86 commits

Author SHA1 Message Date
Victoria Brekenfeld
b28f92a6e1 focus: Don't consider XWaylandGrab exclusive 2025-08-16 01:19:35 +02:00
Victoria Brekenfeld
0095b6d505 order: Newer override-redirect windows are higher in the stack 2025-08-13 16:27:44 +02:00
Ian Douglas Scott
d6c1ca8c33 Use &dyn to simplify pointer/keyboard/touch target dispatch
Requires https://github.com/Smithay/smithay/pull/1334.
2025-07-30 19:01:32 +02:00
Victoria Brekenfeld
adedb705e7 shell: handle fullscreen windows on a dedicated layer
I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.

Here is a rough list of changes:

- Fullscreen windows aren't mapped to other layers anymore
  - This they need their own logic for:
    - Sending frames
    - Dmabuf Feedback
    - Primary outputs
    - On commit handlers
    - cursor tests
  - They get their own unmap/remap logic
  - They get a new restore state similar to minimized windows
    - Refactored the minimized window state to reuse as much as possible
      here
  - They need to be part of focus stacks, which means adjusting them
    to a new type `FocusTarget` as they previously only handled
    `CosmicMapped`.
  - Various shell handlers (minimize, move, menu) now have dedicated
    logic for fullscreen surfaces
    - This was partially necessary due to relying on CosmicSurface now,
      partially because they should've had their own logic from the
      start. E.g. the context menu is now reflecting the fullscreen
      state
- Fullscreen windows may be rendered behind other windows now, when they
  loose focus.
  - This needed changes to input handling / rendering
2025-07-04 19:45:54 +02:00
Ian Douglas Scott
30d68af051 Improved handling of XWayland grabs
A solution for https://github.com/Smithay/smithay/issues/1714.

With this, the lock screen is able to get keyboard focus normally, but
focus then reverts to the XWayland grab surface. This can be tested with
the example client from the issue.

Adding a new variant of `KeyboardFocusTarget` is annoying. Maybe it
could map to a different variant of the enum. But it presumably needs to
handle any `wl_surface` XWayland uses. (Override redirect surfaces?
Subsurfaces?) This seems as good as anything for now.
2025-07-02 11:16:53 +02:00
Victoria Brekenfeld
a65e1d6b5f debug: More profiling annotations 2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
465813c1c5 shell: Using parking_lot's RwLock for fairness guarantees 2025-05-27 20:00:21 +02:00
Victoria Brekenfeld
cbc4ad6fc2 xwayland: Allow eavesdropping on certain keyboard/pointer events 2025-04-02 17:26:09 +02:00
Victoria Brekenfeld
0ba0a0cdaa a11y/zoom: zoom level per output 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
b62e47ef8d a11y/zoom: Allow hiding the overlay 2025-03-28 18:35:06 +01:00
Victoria Brekenfeld
07a471f285 zoom: Don't render at 100% scale while animating 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
f72d2b91f3 shell: Add zoom UI 2025-02-20 23:51:55 +01:00
Victoria Brekenfeld
db13eea91c shell: Allow active workspace to be None 2025-01-06 20:23:05 +01:00
Victoria Brekenfeld
7ac204ee79 focus: Fix active/focused output on refresh_focus
Previously removing the last output could have left seats with an
invalid active output. We already have logic to check this in
`refresh_focus` but failed to apply it before `update_pointer_focus`.
Let's fix that.
2024-12-16 20:14:37 +01:00
Victoria Brekenfeld
7829e7696d focus: Only consider focused output 2024-12-05 18:37:09 +01:00
Victoria Brekenfeld
fce52cb6a2 focus: Un-activate non-active workspaces 2024-12-05 18:37:09 +01:00
Victoria Brekenfeld
9a9eddb132 focus: Fix layer-popup locations 2024-10-23 17:35:06 +02:00
Victoria Brekenfeld
0092dac08c input: Use render_input_order 2024-10-22 19:43:47 +02:00
Victoria Brekenfeld
140d870e7b focus: Introduce render_input_order 2024-10-22 19:43:47 +02:00
may
a4d875e35e cursor follows focus to center of window 2024-10-10 20:49:43 +02:00
Victoria Brekenfeld
b111c9ff48 shell: Rewrite get_focused_output to properly account for groups 2024-09-10 19:38:48 +02:00
Victoria Brekenfeld
16d9902770 focus: Allow updating cursor to already focused window 2024-09-09 20:02:36 +02:00
skewballfox
7da0bc430a added cursor_follows_focus and focus_follows_cursor 2024-09-04 20:22:40 +02:00
julianbraha
52ad30c264 Remove unnecessary lifetimes 2024-08-30 17:53:56 +02:00
Ian Douglas Scott
3625454420 Use monotonic time instead of 0 for motion events
Update to https://github.com/Smithay/smithay/pull/1509, and adopt a
similar change.
2024-08-22 07:22:44 -06:00
Ian Douglas Scott
ca6f05c585 Update pointer focus before motion occurs
If the surface under the pointer has changed, we should send an `enter`
event immediately, instead of waiting for the next motion event. This
seems to fix that, without producing unnecessary events.

Instead of `time: 0`, this and other synthesized events should probably
use `CLOCK_MONOTONIC`. It seems libinput does document that it uses
that.
2024-08-21 13:36:58 -06:00
Victoria Brekenfeld
d4926c3a9e shell: Allow dragged windows to be focused 2024-07-17 18:57:21 +02:00
Victoria Brekenfeld
d85b6f0e50 focus: set minimized windows unfocused 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
c06529b548 focus: Don't send enter/leave for same surface 2024-07-10 22:36:40 +02:00
Victoria Brekenfeld
dc882ffc36 focus: Fall back to first window, if stack is empty 2024-07-03 21:03:58 +02:00
Michael Aaron Murphy
553c49b42b feat: runtime configurable keybindings 2024-07-01 15:20:23 +02:00
Victoria Brekenfeld
953c277cb0 focus: Fix crash when no output is available 2024-06-27 12:35:01 +02:00
Victoria Brekenfeld
c7d50e7c5b seat: Make render-related state thread-safe 2024-06-26 12:59:33 +02:00
Victoria Brekenfeld
b5dcec5215 focus: Don't stack overflow because None=None 2024-06-06 13:07:29 +02:00
Ian Douglas Scott
d9a1ec04bd Set clipboard/primary focus in refresh_focus
This should fix https://github.com/pop-os/cosmic-comp/issues/494, and
make clipboard and primary focus consistently correct.

Changing the active element of a stack needs to change the clipboard
focus, but it wasn't being changed since the `KeyboardFocusTarget` was
unchanged. The `CosmicStack` methods that change the active stack
element also have no obvious way to change the keyboard focus. So we can
set this in `refresh_focus`, which should be correct.

If the new focus `WlSurface` is `None`, this clears the focus instead of
leaving it as the previous code did. I believe that is desirable.

Requires https://github.com/Smithay/smithay/pull/1442 to avoid repeated
`offer`s, instead of only when focus changed.

(Perhaps this could better be solved by having a `WlSurface` variant of
`KeyboardFocusTarget`, like pointer focus, or some mechanism for a stack
of focus, which could help other things. But it's also unclear exactly
how that would work with the code for setting the active stack element,
among other questions.)
2024-06-04 13:24:25 +02:00
Ian Douglas Scott
4f076e0753 Update smithay, with xwayland shell, Cow, etc. 2024-05-21 19:31:50 +02:00
Victoria Brekenfeld
5d5a510691 state: Move shell behind RwLock 2024-04-16 18:50:54 +02:00
Victoria Brekenfeld
647deb81f1 shell: Move seats into shell 2024-04-16 18:50:54 +02:00
Ian Douglas Scott
d16a9e387d Remove outdated TODO comment 2024-04-15 11:37:03 +02:00
Ian Douglas Scott
1da3c7c41e shell: Touch support for ResizeForkTarget/ResizeForkGrab
This seems to be working, though it's quite difficult to actually hit the
small target with touch.
2024-04-15 11:37:03 +02:00
Ian Douglas Scott
26d2556be0 Initial touch support for SSD 2024-04-02 17:12:28 +02:00
Ian Douglas Scott
9e5ce71e1c Run cargo fmt 2024-04-02 17:12:28 +02:00
Victoria Brekenfeld
cf75bc1952 chore: Update smithay/libcosmic 2024-03-26 18:50:56 +01:00
Victoria Brekenfeld
3cff426805 focus: Fix screencopy 2024-03-26 18:50:56 +01:00
Victoria Brekenfeld
5459f52d5e input: Rework PointerFocus to operate directly on WlSurface 2024-03-26 18:50:56 +01:00
Victoria Brekenfeld
dcf1fce28a focus: Fix endless raising window cycle 2024-03-05 13:53:59 +01:00
Victoria Brekenfeld
3eb7e5f82e shell: implement minimize 2024-03-04 19:20:52 +01:00
Ian Douglas Scott
3036448c19 Update Smithay, with Window that supports X11 surfaces 2024-02-22 17:49:46 +01:00
Victoria Brekenfeld
f928f80f09 formatting fixes 2024-01-02 13:24:07 +01:00
Victoria Brekenfeld
e67e139e15 focus: Allow sticky windows in focus_stacks, allow dialogs to stay on top 2024-01-02 13:24:07 +01:00