Commit graph

1879 commits

Author SHA1 Message Date
01micko
481b849152 labwc.pot: update for new OmniPresent menu
closes #1311
2023-12-12 07:28:11 +01:00
Tomi Ollila
c5852db5b5 docs/labwc-theme.5.scd: made text fit in max 80-column wide lines
For general consistency and better readability as source.
2023-12-11 21:58:35 +00:00
kyak
268191fce8
Add theme option to configure boxes from workspace OSD
This allows to configure width and height of "boxes" displayed in the
workspace OSD. A setting of `0` disables the boxes.
2023-12-11 10:41:33 +01:00
kyak
45e0dad3f1
src/output.c: fix strncpy warning
Fixes #1307
2023-12-11 10:33:06 +01:00
Johan Malm
5cc6a5b3e1 theme: partially revert c79b8ba
...so that svg and png icons only support the max_toggled_hover format.

There is no need to support max_hover_toggled because there are no
backward compatibility considerations as Openbox does not handle png and
svg icons.
2023-12-09 22:19:23 +01:00
Johan Malm
393f8fadab theme: use max_toggled_hover.xbm
...and treat max_hover_toggled.xbm as an alternative name supported for
compatibility reasons.

Use the following button filename schema: "BUTTON [TOGGLED] [STATE]"
with the words separted by underscore and with the following meaning:
  - BUTTON can be one of 'max', 'iconify', 'close', 'menu'
  - TOGGLED is either 'toggled' or nothing
  - STATE is 'hover' or nothing.

This is consistent with the openbox.org wiki and it is believed that this
is how the vast majority of extant openbox themes out there are written.

But please be aware that it is actually different to vanilla Openbox which
uses: "BUTTON [STATE] [TOGGLED]" following a commit in 2014 which broke
themes and led to some distros patching Openbox:
35e92e4c2a

Arch Linux and Debian patch Openbox to keep the old syntax (the one that
this commit aligns us with).
https://gitlab.archlinux.org/archlinux/packaging/packages/openbox/-/blob/main/debian-887908.patch?ref_type=heads
2023-12-09 22:19:23 +01:00
Johan Malm
aef39a238c theme: make button array definition easier to read
No functional change intended.
2023-12-09 22:19:23 +01:00
kyak
111b955b53
Implement key binds to control virtual outputs (#1287)
Add actions `VirtualOutputAdd` and `VirtualOutputRemove`
2023-12-09 09:01:11 +00:00
Andrew J. Hesford
e303281333 view: continue move-to-edge behavior to adjacent outputs 2023-12-09 08:50:32 +00:00
Johan Malm
59dc4b702a labwc-config(5): update <margin> description
...to include that it is a workaround which is usually not required.
2023-12-08 23:56:00 +01:00
Johan Malm
8d220536e0 Partially revert a bit more of ddc9047
...to enable re-size of nested labwc instances
2023-12-08 22:13:02 +00:00
Johan Malm
b05b5ba0cf Partially revert ddc9047
...to just call wlr_scene_output_commit() as was previously the case and
thus avoid freezing screens reported by a number of users.

Fixes: #1273
2023-12-08 22:13:02 +00:00
Consolatis
1149b31c7f src/ssd: refactor button hover and maximize toggle 2023-12-08 20:55:50 +00:00
Consolatis
02aa000b0d src/layers.c: move popups from the background layer to the top layer
Previously we would only do that for the bottom layer.

Fixes #1293

Reported-by: @spl237
2023-12-07 11:11:47 +01:00
Ludgie
b34d074063
feat: implement <font place="InactiveWindow"> (ref scope: 2.4.7) (#1292)
* feat: implement <font place="InactiveWindow"> (ref scope: 2.4.7)
* docs: add inactivewindow
2023-12-07 09:28:27 +01:00
Consolatis
d59b1d0966 src/layers.c: calculate usable_area before positioning clients
This ensures that the usable area is completely calculated
before non exclusive-zone clients are positioned / resized.

Fixes #1285
Reported-by: @spl237
2023-12-06 22:04:07 +00:00
Johan Malm
5bc58fc381 theme: fix icon bug
Do not carry over previous alt_filename for icons that don't have one.
2023-12-06 23:02:23 +01:00
Simon Long
c79b8ba8a7
Support hover icons in titlebar (#1280)
Allow both max_toggled_hover and max_hover_toggled names for icons
2023-12-06 20:33:26 +00:00
Consus
5d2f594626 Implement cursor-shape-v1 protocol
This protocol allows Wayland clients to request a buffer for a cursor
shape from a compositor.

Tested with foot.
2023-12-05 09:59:40 +01:00
Consus
3118886097 Fix a typo 2023-12-05 09:59:40 +01:00
Consus
3ca0d8a171 Unwrap #define value
In the name of constistency do not wrap the value in parenthesis if the
value is a single number.
2023-12-03 23:04:35 +01:00
Consus
e36c065c7b Implement fractional-scale-v1 protocol
This protocol allows Wayland clients to properly scale on outputs with
fractional scale factor.

Tested with foot and transmission-qt (Qt6).
2023-12-03 23:04:35 +01:00
nullableVoidPtr
bf326cc8f1 chase (dnd): refactor to use wlroot's scene_drag_icon 2023-12-03 18:24:26 +00:00
nullableVoidPtr
41891209fc chase: use wlroots tree node getters 2023-12-03 18:24:26 +00:00
Consolatis
e841d44b6f src/output.c: ensure we don't carry around a stale output pointer
Prevent carrying around the wlr_output->data pointer when
destroying an output. The set_gamma handler may be called
during the destruction of a wlr_output after our own
destroy handler has already been called. This patch resets
the wlr_output->data pointer in our destroy handler and
adds a check in the set_gamma handler to verify the output
is actually valid.

Fixes #1270

Reported-by: @Flrian
2023-12-02 15:27:00 +01:00
Johan Malm
fcf21e1464 chase: handle gamma-control-v1 set_gamma events
References:
- https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4046
- https://github.com/swaywm/sway/pull/7494/files

Fixes: #1262
2023-12-01 22:30:17 +00:00
Johan Malm
9c1c96f993 Add ResizeTo action
Fixes: #1261
2023-12-01 21:23:42 +00:00
Jens Peters
590ec0c77d keyboard: allow back by arrow-up or arrow-left in cycle view OSD
All non-modifier keys cycle forward which makes sense for
e.g. tab but is not very intuitive for arrow-up or arrow-left.
Handle those keys separately to provide a feel of navigation
by arrow keys in the cycle view OSD.
2023-11-30 22:39:01 +00:00
John Lindgren
738ae6c5d5 keyboard: break up handle_compositor_keybindings()
This function has grown quite large over time. Breaking out various
smaller functions makes the logic easier to follow.

No functional change intended, but there is a minor logical change:

- Due to factoring out match_keybinding(), each keypress can only
  match a single keybinding now. Previously, it was theoretically
  possible for a single keypress to map to multiple keysyms which could
  each match a different keybinding.
2023-11-30 20:42:16 +00:00
John Lindgren
83e67b32b6 xwayland: treat X11 panel views as if fixedPosition rule is set 2023-11-29 06:48:31 +00:00
John Lindgren
0a5255f062 output,xwayland: Add support for _NET_WM_STRUT_PARTIAL
Account for space taken up by XWayland panels (as indicated by the
_NET_WM_STRUT_PARTIAL property) in the usable_area calculation.

This makes it possible to use labwc in a "transitional" setup, where it
replaces the X11 window manager and compositor, but most other parts of
a existing X11 desktop environment can still be used via XWayland.

(Some remaining drawbacks of such a setup would be the lack of desktop
icons, and native Wayland clients not showing up in X11-based taskbars.)
2023-11-29 06:48:31 +00:00
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