Commit graph

2381 commits

Author SHA1 Message Date
tokyo4j
46ec513630 view: implement cascade placement policy
Adds following settings:
<placement>
  <policy>cascade</policy>
  <cascadeOffset x="40" y="30" />
</placement>

"Cascade" policy places a new window at the center of the screen like
"center" policy, but possibly shifts its position to bottom-right so the
new window doesn't cover existing windows.

The algorithm is copied from KWin's implementation:
df9f8f8346/src/placement.cpp (L589)

Also added some helper functions to manipulate `wlr_box`.
2024-07-20 08:59:46 +01:00
John Lindgren
3be8fe25f3 xdg: handle initially maximized xdg-shell views better
Currently, initially maximized (or fullscreen) xdg-shell views exhibit
one of two issues:

 - some (e.g. GTK and Qt apps) paint an initial frame un-maximized
   (before the "map" event) and only maximize in a later commit

 - others (e.g. foot) maximize immediately without flicker, but never
   store a valid natural size, so we end up using a fallback (640x480)

Under KWin, neither of these issues occur, so I looked into what labwc
is doing wrong. It seems that:

 - wlroots internally sends an initial configure event with a size of
   0x0 to all xdg-shell views. This requests the client to set its own
   preferred (a.k.a. natural) size.

 - For an initially maximized/fullscreen view, the initial configure
   event should contain the maximized/fullscreen size rather than 0x0.
   In labwc, this means we have to call wlr_xdg_toplevel_set_size()
   earlier, i.e. from the new_surface event. Tracing with WAYLAND_DEBUG
   shows that the initial configure event now has the correct geometry,
   matching KWin behavior. With this change, GTK and Qt apps no longer
   paint an incorrect un-maximized frame.

 - However, this means that all xdg-shell views now suffer from the same
   issue as foot, where we never receive a commit with the un-maximized
   (natural) geometry. The correct way to get the natural geometry seems
   to be to wait until we want to un-maximize, and send a configure
   event of 0x0 at that point.

Sending a configure event of 0x0 when un-maximizing is a bit annoying as
it breaks some assumptions in labwc code. In particular:

 - view->natural_geometry may now be unknown (0x0), requiring various
   wlr_box_empty() checks sprinkled around. I added these in all the
   obvious places, but there could be some code paths that I missed.

 - Positioning the newly un-maximized view within view_maximize() no
   longer works since we don't know the natural size. Instead we have to
   run the positioning logic from the surface commit handler. This
   results in some extra complexity, especially for interactive move.
   See the new do_late_positioning() function in xdg.c.

Some TODOs/FIXMEs (non-blocking in my opinion):

 - The view_wants_decorations() check is now duplicated in both the
   new_surface and map event handlers. I'm not sure if this is necessary
   but it seemed like the safest approach for now. More testing would be
   nice, particularly with various combinations of config and client SSD
   preferences.

 - Aside from the interactive move case, the "late positioning" logic
   always centers the view when un-maximizing, and does not invoke any
   of the smart placement logic. If we want to invoke smart placement
   here, I'd appreciate someone with more knowledge of that code to take
   a look and figure out how to do that correctly.
2024-07-19 22:48:39 +01:00
Jens Peters
e26ec472b2 docs: add tablet tool section 2024-07-19 22:45:41 +01:00
Jens Peters
3f210828d7 input: log tablet pad capabilities 2024-07-19 22:45:41 +01:00
Jens Peters
f4d203f0cd input: support tablet tool motion sensitivity configuration 2024-07-19 22:45:41 +01:00
Jens Peters
bcd5746a32 config: add configuration for tablet tool motion sensitivity 2024-07-19 22:45:41 +01:00
Jens Peters
96701f1e27 input: support tablet tool motion configuration 2024-07-19 22:45:41 +01:00
Jens Peters
a2f25bea1a config: add configuration for tablet tool motion 2024-07-19 22:45:41 +01:00
Jens Peters
8501a1281c input: support tablet tools with relative motion 2024-07-19 22:45:41 +01:00
Jens Peters
b663c9ea46 input: fix rotation for tilt
The transformation for relative coordinates
is different than for absolute coordinates.
2024-07-19 22:45:41 +01:00
Jens Peters
ba9de228e0 input: add relative cursor move emulation 2024-07-19 22:45:41 +01:00
John Lindgren
c9018da4c4 xwayland: set initial geometry in map_request handler
Set the initial geometry of maximized/fullscreen views before
actually mapping them, so that they can do their initial layout and
drawing with the correct geometry. This avoids visual glitches and
also avoids undesired layout changes with some apps (e.g. HomeBank).

Fixes: #1320

v2: ensure valid geometry for unmanaged->managed case
2024-07-19 22:40:43 +01:00
Johan Malm
c3ea956837 Disable pango glyph position rounding
Chase 8c5b23e592

Pango rounds glyph position and widths to nearest integer, which leads to
font dimensions jumping around when rendering with a scale, causing text
geometry to jump around when changing scale.

Disable this rounding to make the geometry stable.
2024-07-19 22:17:42 +01:00
Consolatis
c20c3991c7 ssd: make borders respect snapped state on Reconfigure
Fixes: #1862
2024-07-19 21:52:26 +01:00
Christopher Snowhill
9e9c29d7f5 config: initialize some missing defaults 2024-07-18 03:09:56 +02:00
Consolatis
40684bad9d magnifier: disable direct scanout when active
Fixes: #1980
2024-07-17 22:44:48 +02:00
Consolatis
8ddfcb80e5 CI: switch Arch and FreeBSD to wlroots 0.18
Also add wlroots0.18-devel to Void, assuming that is what the
package will be called once available. For previous packaging
see https://github.com/void-linux/void-packages/pull/48323/files
2024-07-17 21:28:59 +01:00
Consolatis
93f817e20e chase: wlroots.wrap: track the wlroots 0.18 branch 2024-07-17 21:28:59 +01:00
Consolatis
0d00e9a232 chase: move to stable tablet protocol and require w-p >= 1.35
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4645
2024-07-17 21:28:59 +01:00
Consolatis
924e31f089 chase: version pkgconfig, headers, and library
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4614
2024-07-17 21:28:59 +01:00
Consolatis
d16c6dd63a chase: tablet_pad to tablet
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4585
2024-07-17 21:28:59 +01:00
Consolatis
5c6e1ed878 chase: use wayland pointer enums rather than wlr ones
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
2024-07-17 21:28:59 +01:00
Consolatis
d8d45dc2cb chase: request initial configure
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4396
2024-07-17 21:28:59 +01:00
Consolatis
0a03c00b8b chase: backend create now requires event_loop arg
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4443
2024-07-17 21:28:59 +01:00
Consolatis
36b0dc2db4 chase: output->pending
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4202
2024-07-17 21:28:59 +01:00
Consolatis
0d354519e8 chase: relative axis direction
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4003
2024-07-17 21:28:59 +01:00
Consolatis
d8f57fe4e7 chase: presentation is now handled internally
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4482
2024-07-17 21:28:59 +01:00
Consolatis
72fd2af4f2 chase: tearing hint
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4480
2024-07-17 21:28:59 +01:00
Consolatis
6becc02ca4 chase: let wlr_scene track damage again
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4253
2024-07-17 21:28:59 +01:00
Consolatis
d2579a0088 chase: handle xdg new toplevel event
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345
2024-07-17 21:28:59 +01:00
Consolatis
3b2ab4a48e chase: move xdg destroy signal to toplevel / popup
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345
2024-07-17 21:28:59 +01:00
Consolatis
50047db8b2 chase: output-layout takes wl_display in constructor
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4310
2024-07-17 21:28:59 +01:00
Consolatis
d37309008c chase: disable restacking of unmanaged windows
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4052
2024-07-17 21:28:59 +01:00
Consolatis
3e614814fe chase: input inhibit removal
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4440
2024-07-17 21:28:59 +01:00
Consolatis
d1fbb3c7cc chase: wlroots version dep to 0.18 2024-07-17 21:28:59 +01:00
Johan Malm
7dd7b5cc59 menu: fix crash triggered by pipemenu without parent <menu>
...such as the one in the example below:

    <?xml version="1.0" encoding="UTF-8"?>
    <openbox_menu>
      <menu id="root-menu" label="obmenu-generator" execute="obmenu-generator"/>
    </openbox_menu>

We should consider supporting this construct in future.

Reported-by: cry0xen via IRC
2024-07-15 22:00:11 +01:00
Consolatis
714511736b src/xdg.c: verify source surface for xdg_activation request
wlroots < 0.17 didn't allow to reliably check the source surface of
an xdg activation request as it reset the surface to NULL when it
was destroyed before the token was used. This happens regularly for
notifications for example. Thus we treated the token as valid even
without checking for the source surface.

wlroots 0.17 added a new_token signal where we can attach information
to the existing token which we can then use when evaluating activation
requests. This patch implements that check.
2024-07-14 22:11:12 +02:00
Consolatis
e9fdd1f493 CI: add wlroots 0.17 packages for Arch and FreeBSD 2024-07-14 22:02:40 +02:00
Birger Schacht
3be20dc6c7 docs: fix typo in labwc-config.5.scd 2024-07-13 09:46:29 -04:00
Johan Malm
307f199158 build: bump version to 0.7.3 2024-07-12 17:27:36 +01:00
Johan Malm
80ae55136e NEWS.md: update for 0.7.3 2024-07-12 17:19:00 +01:00
Weblate
c7b3f4f9d8 Translation updates from weblate
Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: tark1998 <tark1998@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ko/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/nl/
Translation: Labwc/labwc
2024-07-08 21:11:46 +01:00
John Lindgren
b1a6a36582 menu: fix small memory leaks 2024-07-08 19:44:50 +01:00
John Lindgren
3ca1e94b1f menu: try other paths (and fix memory leak) if fopen() fails 2024-07-08 19:44:50 +01:00
John Lindgren
5979cc137a theme: fix memory leak of button icons 2024-07-08 19:44:50 +01:00
tokyo4j
1b122422f5 session-lock: clear focused surface on lock
Before this commit, keyboard events were sent to the focused surface
before the session-lock client maps its surfaces.
2024-07-07 15:48:32 +09:00
tokyo4j
6bc93cf468 session-lock: restore focused view on unlock
Before this commit, the topmost view is focused on unlock. This commit
changes it to remember the focused view on lock then restore it on
unlock.
2024-07-07 15:48:32 +09:00
tokyo4j
880522d142 session-lock: never allow multiple session-locks
I forgot to set session_lock_manager->lock, so it was always NULL.
This barely worked, but allowed multiple session-locks and conflicted
with comments in session-lock.h.
2024-07-07 15:48:32 +09:00
tokyo4j
11f02075c2 session-lock: refactor
No changes in logic.
2024-07-07 15:48:32 +09:00
tokyo4j
30694c2174 session-lock: remove cruft
The color to fill screen with is always black and we don't need reset
its color on every session-lock destruction.
2024-07-07 15:48:32 +09:00