Commit graph

1408 commits

Author SHA1 Message Date
Consolatis
b62159fe06 docs/rc.xml: Overwrite the default W-Return keybind
.. instead of adding a new one.
Also change from sakura to foot and add comments.
2023-01-06 21:40:49 +00:00
Consolatis
b12b6b320e src/action.c: Improve debugging by adding action argument to debug log 2023-01-06 21:38:12 +00:00
Consolatis
bc4108fec0 output: Use better arg naming for output_update_all_usable_areas()
This restores the original approach of naming the argument `layout_changed`
which fits much better than `enforce_view_arrange`. Especially when extending
the function to also handle region updates once merged.
2023-01-06 20:39:04 +01:00
Consolatis
7b48da4ab2 include/labwc.h: Provide MIN/MAX macros 2023-01-06 18:33:25 +01:00
Consolatis
9d7386effd include/ssd.h: prefix defines with SSD_ 2023-01-06 18:32:36 +01:00
Consolatis
7790da7b4e src/view.c: move xwayland specific function to xwayland.c
Also remove the `<xcb/xcb_icccm.h>` include as its already included
by `"labwc.h"` -> `<wlr/xwayland.h>` -> `<wlr/xwayland/xwayland.h>`.
2023-01-06 14:54:28 +01:00
John Lindgren
ed31381eb8 output: Add output_update_usable_area/all_usable_areas()
Move the desktop_arrange_all_views() call outside layers_arrange() into
a new function, output_update_usable_area().  The new function currently
does exactly what layers_arrange() used to, but will be expanded in a
later commit.

Add output_update_all_usable_areas(), which is the same as calling
output_update_usable_area() for each output, but only calls
desktop_arrange_all_views() once.

Rebased and slightly modified by @Consolatis
2023-01-06 14:51:46 +01:00
Johan Malm
af56b68041 theme: support theme setting override
...by reading <config-dir>/themerc-override where <config-dir> is normally
$HOME/.config/labwc can be other locations as described in labwc-config(5)
and can also be specified by the command line option -C.

The reason for supporting theme override is to give users more fine-
grained control of settings without making local copies and modifying
themes.
2023-01-03 21:21:21 +00:00
yuanye
d82d8117f7 src/output.c: Release layer tree when releasing output
Split off from PR #622 and slightly modified by @Consolatis
2023-01-03 19:46:31 +00:00
Consolatis
c75508fcc5 src/view.c: ensure natural geometry is restored even with no outputs available
Reported-by: @Flrian
2023-01-03 19:46:31 +00:00
Consolatis
0d8b459912 src/layers.c: destroy layer surface on output loss 2023-01-03 19:46:31 +00:00
Consolatis
a4c1c4815e src/layers.c: ensure layers_arrange() is only called with an output set 2023-01-03 19:46:31 +00:00
Consolatis
c241d89c7c src/layers.c: remove new_popup handler on node destruction 2023-01-03 19:46:31 +00:00
Consolatis
cd645318e7 src/layers.c: prevent crash with no outputs available 2023-01-03 19:46:31 +00:00
Consolatis
e9aac4ce8f src/view.c: prevent fullscreen with no outputs available 2023-01-03 19:46:31 +00:00
Consolatis
de8042bff5 src/output.c: prevent crash with no outputs available 2023-01-03 19:46:31 +00:00
Consolatis
8bde7bcee0 src/debug.c: reset last_view
Before this patch following would cause a use-after-free:
- calling the Debug action when there was at least one view around
- closing that view
- calling the Debug action again

Also add a label for the layer popup tree.
2023-01-02 21:52:09 +00:00
01micko
bc65357267 po/tr.po: update Turkish translation
thanks to @ersen0
2023-01-02 21:39:56 +00:00
Johan Malm
f70425f2ea po/sv.po: update Swedish translation 2023-01-02 21:39:56 +00:00
01micko
e54672e151 po/es.po,it.po: update Spanish and Italian translations 2023-01-02 21:39:56 +00:00
01micko
3d609edbce po/de.po: update German translation
thanks to @Consolatis
2023-01-02 21:39:56 +00:00
01micko
9e954dfcd0 nls: updates for new strings in menus
- also fixes updating tr.po file
- more descriptive instructions in CONTRIBUTING.md
- fix comments in po/pot files when using meson gettext tools
2023-01-02 21:39:56 +00:00
Joshua Ashton
4fa2091677 server: Filter out wp_drm_lease_device from Xwayland
For now, until we resolve the true cause here either on the Xwayland
side or our side.

I intend to look into it soon.

Fixes: #553
2023-01-02 21:26:42 +00:00
Joshua Ashton
a81ae09245 build: Add drm-lease-v1 protocol to server_protocols 2023-01-02 21:26:42 +00:00
Consolatis
8c411acf1a src/view.c: move up view_apply_natural_geometry()
So its visible by all the other view_apply_xxx_geometry() functions.
2023-01-02 16:42:07 +01:00
Johan Malm
45ce978b5a docs/themerc: add menu.width.{min,max} + menu.items.padding.{x,y}
...to reflect additions introduced by f0666ba and d00327b

Move menu.overlap.* to the menu section for a more logical grouping
2023-01-01 18:59:16 +00:00
Johan Malm
241e7de2b1 menu: minor refactoring to increase readability 2023-01-01 18:59:16 +00:00
Consolatis
a08a6c4bd4 src/view.c: reorder includes 2023-01-01 19:48:47 +01:00
Consolatis
1aef488bcc src/view.c: rename unmaximized_geometry to natural_geometry 2023-01-01 18:15:37 +00:00
Consolatis
aab775c5b5 src/view.c: use view_set_untiled() helper 2023-01-01 18:15:37 +00:00
Consolatis
62549e90d6 src/view.c: factor out special case natural geometry checks 2023-01-01 18:15:37 +00:00
Consolatis
03a1953cfa src/view.c: factor out the various view_apply_ variants 2023-01-01 18:15:37 +00:00
Consolatis
84b3df4ef2 src/layers.c: minor simplification 2023-01-01 18:15:37 +00:00
Consolatis
d094533955 src/view.c: on un-fullscreen restore SSD before applying previous geometry
Before this patch following would cause the SSD to be rendered offscreen:
- snap a window to left or right edge
- toggle fullscreen to fullscreen
- toggle fullscreen to un-fullscreen

To fix that restore the SSD before calculating the new geometry.
2023-01-01 02:24:07 +01:00
Consolatis
83a0be1b9c src/view.c: Allow snapping to the same edge
Reported-by: @Flrian via IRC
Debugged-by: @Flrian
Tested-by: @Flrian
2022-12-29 22:24:55 +00:00
Consolatis
0db67a508c ssd: scale down button icons if necessary
This allows using large XBM button icons (larger than
the button width / height) for high and mixed DPI usecases.

Instead of scaling up the low pixel icons when moving a window to a
high DPI output we scale the icons down when moving to a non-scaled
output. The user is still responsible to create / use larger XBM
icons for their theme.

Partly fixes #609
2022-12-29 22:19:13 +00:00
Johan Malm
86fa0c0a65 desktop.c: handle layer-subsurfaces in get_cursor_context()
...to allow these surfaces to receive pointer button events

Test by running `gtk-layer-demo --keyboard exclusive`, then open the
'set margin' dialog and try setting the margin with the pointer.
2022-12-29 23:18:08 +01:00
Johan Malm
15781a394c layer: s/struct wlr_box/output->usable_area/
...because Linux kernel style prefers `sizeof(*foo)` over
`sizeof(struct foo)`.
2022-12-29 23:18:08 +01:00
Johan Malm
7037ea4e8f layer: rename signal-handler functions to handle_*
...rather than *_notify to comply with naming convention agreed on in
CONTRIBUTING.md
2022-12-29 23:18:08 +01:00
Johan Malm
349a38e676 layer: get struct output from wlr_output user-data
...rather than output_from_wlr_output()
2022-12-29 23:18:08 +01:00
Johan Malm
73df50a1c8 layer: s/layers_above_shell/layers_above_views/ 2022-12-29 23:18:08 +01:00
Johan Malm
f01071e72c layer: remove wl_list layers[] from struct output
...and just use `struct wlr_scene_tree *layer_tree[]`
2022-12-29 23:18:08 +01:00
Johan Malm
e7346f71c0 include/layers.h: remove redundant struct wlr_box geo 2022-12-29 23:18:08 +01:00
Johan Malm
9dbac2e06f layer: use scene-graph API more fully
...and thus simplify the usage of wlr_scene_node_at(). Specifically:

- desktop.c: in get_cursor_context() use node-description for
  layer-surfaces and layer-popups. This lays the foundations for a
  pointer-enter-event being sent when a new layer-surfaces appears under
  the pointer (even if the pointer doesn not move).

- layers.c:

  * Iterate over `struct wlr_scene_tree *layer_tree[]` rather than
    `struct wl_list layers[]` when arranging layers to avoid surfaces
    being out of sync with nodes

  * Set signal handlers after scene node creation to avoid configure
    race conditions

  * Handle scene-node destroy event rather than event of
    `struct wlr_layer_surface_v1`

  * Arrange layers on map and unmap

  * Handle client request for layer-change

Fixes issue #667
2022-12-29 23:18:08 +01:00
Consolatis
e39fd341ec src/workspaces.c: prevent re-focus for always-on-top views
Before this patch a focused always-on-top view lost its keyboard
focus when switching workspaces. Now the view keeps its focus.
2022-12-29 18:58:25 +01:00
Consolatis
f7c8663f67 src/workspaces.c: use cached server pointer 2022-12-29 18:58:25 +01:00
Flrian
63632cfd1a docs: update theme documentation
.. to reflect that its now possible to change the color of the menu button
2022-12-23 19:04:28 +01:00
Flrian
6d1d0aecab src/theme.c: add menu to individual buttons 2022-12-23 19:04:28 +01:00
John Lindgren
41a4176b17 rcxml: Make sure a default libinput category always exists
Previously, if rc.xml defined only non-default libinput categories,
no default category was created. This meant that configure_libinput()
might totally skip configuring some devices even with default
settings, like tap-to-click.

Fix this by making sure that a default category is always created.
2022-12-22 22:18:27 +00:00
John Lindgren
500eddbe88 docs: Fix small typo in labwc-config(5) manpage 2022-12-22 23:07:07 +01:00