Commit graph

2485 commits

Author SHA1 Message Date
tokyo4j
701679bae0 ssd: fix crash on app_id updates while the app is in fullscreen
`view->ssd_enabled && view->ssd == NULL` is possible during the client is
in fullscreen. So we need to check if `view->ssd` is NULL first in
`ssd_update_window_icon()`.
2024-09-25 21:44:33 +09:00
tokyo4j
a745f91169 ssd: support window icons
The default `titleLayout` is updated to `icon:iconify,max,close` which
replaces the window menu button with the window icon.

When the icon file is not found or could not be loaded, the window menu
icon as before is shown.

The icon theme can be selected with `<theme><icon>`.

This commit adds libsfdo as an optional dependency. `-Dicon=disabled` can
be passsed to `meson setup` command in order to disable window icon, in
which case the window icon is always replaced with a window menu button.
2024-09-25 18:04:09 +09:00
Jens Peters
b9414d8b8d action: implicitely unmaximize when unsnapping
Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
694c5a7469 action: add UnSnap action
Same untiling behavior as ToggleSnapToEdge/Region,
but unconditionally.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
cb2e2c1016 action: add ToggleSnapToEdge/Region actions
Behaves identical like SnapToEdge and SnapToRegion, but
untiles the window when already being tiled to the given
region or direction.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Jens Peters
4fd7a8075c view: expose view_apply_natural_geometry()
Co-authored-by: tokyo4j <hrak1529@gmail.com>
2024-09-25 17:59:10 +09:00
Johan Malm
f1141c62d4 ci: disable debian build checks until dependencies can be met 2024-09-24 20:32:32 +01:00
Johan Malm
9d251a96b1 theme: fix incorrect default for <titlebar><showTitle> 2024-09-24 19:59:46 +01:00
Weblate
95bc420403 Translation updates from weblate
Co-authored-by: Ihor Hordiichuk <igor_ck@outlook.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/uk/
Translation: Labwc/labwc
2024-09-24 19:49:30 +01:00
David Turner
ff012fa331 Don't detect edge-resizes in configure timeout
If a client times out responding to a configure request then the
handle_configure_timeout() callback is run.  This cleans up the pending
state and moves the view to the pending location, but keeps the current
size. The idea is to stop slow applications causing too much lag when
the user manipulates the window.  This callback used
view_impl_apply_geometry() to actually apply the changes.

view_impl_apply_geometry() contains some heuristics to detect if we're
resizing a window from the top, left, or top-left, and if so to do the
expected behaviour of keeping the window's bottom/right corner in the
same place.  However, that code was erroneously triggering in the case
when the user requests to change a window from maximized to fullscreen
but the client times out on the configure request.
handle_configure_timeout() decides to enact the movement of the window
but keep its size at the old size and tells view_impl_apply_geometry()
to do that.

The current view position and size is 0,64 1920x1016, the pending
position/size is 0,0 1920x1080, and the last committed size is
1920x1016.  Looking at the current and pending position and size, the
height changes while the bottom edge stays in the same place so this
looks like a top-edge-resize and view_impl_apply_geometry() decides to
keep the window's bottom edge in the same place while setting the
position according to the last-committed size.  This results in the
window staying at position 0,64 size 1920x1016 despite being marked as
fullscreen.

My solution to this is just to change handle_configure_timeout() to
directly change the view's position and call view_moved() if necessary.
The idea of handle_configure_timeout() is to action the window movement
now while discarding the size change, and let the size change take place
later on when the client catches up.  The logic of
view_impl_apply_geometry() doesn't make sense in this case so just avoid
it entirely.

Fixes #1922
2024-09-24 19:45:16 +01:00
Johan Malm
e5f60ce8a7 ci: use -Wno-expansion-to-defined to avoid Arch CI error
...with this warning message:

[100/161] Compiling C object labwc.p/src_button_button-svg.c.o
FAILED: labwc.p/src_button_button-svg.c.o
gcc -Ilabwc.p -I. -I.. -Iinclude -I../include -I/usr/include/wlroots-0.18 -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/lib/pkgconfig/../../include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O0 -g -DWLR_USE_UNSTABLE -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wunused-macros -Wno-unused-parameter '-DLABWC_VERSION="0.8.0"' '-DGETTEXT_PACKAGE="labwc"' '-DLOCALEDIR="/usr/local/share/locale"' -pthread -MD -MQ labwc.p/src_button_button-svg.c.o -MF labwc.p/src_button_button-svg.c.o.d -o labwc.p/src_button_button-svg.c.o -c ../src/button/button-svg.c
In file included from ../src/button/button-svg.c:7:
/usr/lib/pkgconfig/../../include/librsvg-2.0/librsvg/rsvg.h:1331:1: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
 1331 | #if LIBRSVG_CHECK_FEATURE(PIXBUF)
      | ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
2024-09-24 07:15:13 +09:00
Weblate
4acac07323 Translation updates from weblate
Co-authored-by: Abdullah Albaroty <albaroty@gmail.com>
Co-authored-by: Priit Jõerüüt <lxqtwlate@joeruut.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/ar/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/et/
Translation: Labwc/labwc
2024-09-23 21:03:27 +01:00
Johan Malm
cc26ac29b9
theme: finish titleLayout implementation (#2150)
Change Openbox style WLIMC syntax to `menu:iconify,max,close` as was
agreed when PR #2088 was merged.

    <titlebar>
      <layout>menu:iconify,max,close</layout>
      <showTitle>yes|on</showTitle>
    </titlebar>

Ref:
- https://github.com/labwc/labwc/pull/2088#issuecomment-2295730704
2024-09-23 19:17:12 +01:00
Weblate
04a145f89a Translation updates from weblate
Co-authored-by: Heimen Stoffels <vistausss@fastmail.com>
Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Co-authored-by: Jan Rolski <wbcwknvstb@proton.me>
Co-authored-by: Standreas <standreas@riseup.net>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/it/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/nl/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pl/
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt/
Translation: Labwc/labwc
2024-09-21 22:05:03 +01:00
Weblate
09bd2a59c8 Translation updates from weblate
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/
Translation: Labwc/labwc
2024-09-21 19:17:17 +01:00
tokyo4j
80e7b64a41 xdg: handle show_window_menu requests 2024-09-21 18:34:17 +01:00
tokyo4j
31fec2f9cb xdg: don't always adjust the window size before configure
This fixes the small flicker when the client initially submits a window
size smaller than the minimum value.
2024-09-21 18:08:29 +01:00
tokyo4j
25f5cdd3a6 Refactor the logic of placing client-menu with ShowMenu action
Before this commit, we assumed `ShowMenu` action is not bound to any
buttons other than window menu button and always place the client-menu
under the window-menu button when atCursor="no". Also, it was going to be
difficult to distinguish whether the action is executed from the window
menu button or the window icon, which will be added soon.

This commit fixes it to open the menu under the actually-clicked button by
passing `cursor_context` to `actions_run()`, with some refactoring:
- `seat->pressed.resize_edges` is removed and it's calculated from the
  cursor position and `seat->pressed.type` just before running Resize
  action. This slightly changes the existing logic to determine the
  resizing edges with Alt-Right + Drag mousebinding, but
  `seat->pressed.type` is still stored on button press so it doesn't bring
  back the issue #543.
- `seat->pressed.toplevel` is removed and `get_toplevel()` in
  `update_pressed_surface()` may be called more often, but its overhead
  will be negligible.
2024-09-21 18:07:34 +01:00
tokyo4j
d29464bac7 docs: fix documentation of "atCursor" for dynamic titlebar layout 2024-09-21 14:15:16 +01:00
tokyo4j
14f4d8c361 docs/rc.xml.all: add missing atCursor="no" 2024-09-21 14:15:16 +01:00
Droc
331ded0328 client list combines fix empty title
this adds a check for title being null or empty as well as
existence of toplevel.handle
2024-09-19 20:57:39 +01:00
01micko
0ce9b465b5 labwc.pot: update translation template for 71b2b5a
fixes #2157
2024-09-19 20:32:33 +01:00
Droc
4a1375c701 client send to menu
Shows all workspaces that current view can be sent to.
Works best when added to Client menu.

<menu id="client-send-to-menu" label="Send to..." />

Menu uses ">" and "<"  to highlight the current workspace
2024-09-19 06:36:27 +01:00
Droc
4f11dad45b client list combined menu examples 2024-09-19 06:33:17 +01:00
Droc
d26b868dbe client list combined menu fix
We don't know if the client-list-combined-menu is standalone
ie. triggered by a keybind or a submenu of another menu.
So we update client-list-combined-menu every time ShowMenu is called.
2024-09-18 22:07:41 +01:00
Droc
71b2b5a4bc menu: support client-list-combined-menu
...showing windows across all workspaces.

<action name="ShowMenu" menu="client-list-combined-menu"/>
2024-09-17 22:13:23 +01:00
Johan Malm
fc4bbca6f2 NEWS.md: interim update 2024-09-16 18:45:50 +01:00
Jens Peters
8b1831c731 action: open the client menu underneath the window menu button
It looks slightly awkward when the client menu shows up
in the left corner of the view and the window menu button
is configured to be on the right side.
2024-09-15 22:05:46 +01:00
tokyo4j
e53ec5e5a0 theme: round the hover effect along the window border 2024-09-15 21:52:13 +01:00
Jens Peters
21e92632a6 theme: compensate the hover corner radius with padding
When padding.width is set, the corner radius of the rectangle
hover effect can be smaller since there is more space available.
2024-09-11 21:22:06 +01:00
Jens Peters
9395348c55 theme: add circle button hover effect (#2127) 2024-09-10 22:14:30 +01:00
Jens Peters
dcd9b47e5b theme: ensure positive values (#2127)
Clamp invalid configuration values to zero.
2024-09-10 22:14:30 +01:00
Jens Peters
824b0fa4e3 theme: add button padding and spacing (#2127)
While at it, separate corner width from button
width. Both are independed and having them
separately improves readability.
2024-09-10 22:14:30 +01:00
Droc
8850368ab9 Add position arguments for menus
...utilizing x,y coordinates where values can be a number, a negative
number, a percentage or "center".

- (0,0) is top left corner
- (-0,-0) is bottom right corner
- % is percentage of width and/or height
- 'center' centers the menu vertically and/or horizontally

    <action name="ShowMenu">
      <menu>root-menu</menu>
      <position>
        <x>0</x>
        <y>0</y>
      </position>
    </action>

Note: both x and y values must be supplied for positioning to work.
2024-09-05 22:28:50 +02:00
Weblate
f3b2766892 Translation updates from weblate
Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: daniel <punished.haddock@proton.me>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/pt_BR/
Translation: Labwc/labwc
2024-09-03 22:43:39 +02:00
tokyo4j
1be69dc28b ssd: allow ssd to be smaller than minimal size by hiding buttons
This fixes the ugly look of SSD for tiny windows (e.g. "xterm -geometry
1x1") due to the early return in `ssd_update_geometry()`. Now SSDs are
rendered correctly for those windows by hiding some buttons when the
window width is smaller than the total width of buttons. Additionally for
windows smaller than (button width)*2, the corners are un-rounded so a
small titlebar can be rendered with a scene-rect.
2024-09-03 08:12:25 -04:00
Andrew J. Hesford
b34f2c9d85 Revert "src/interactive.c: don't unshade when view is un-tiled by dragging"
When labwc un-tiles views, it generally changes their size, which sends
a configure request to the client. However, because the view has been
disabled in the wlroots scene, it will not receive and process the
configure when labwc expects. Instead, the handling will be deferred
until the user unshades the view at some arbitrary time in the future,
resulting in labwc registering complains like

    [../src/xdg.c:239] client did not respond to configure request in 100 ms

Furthermore, the reconfigure will still generally produce flicker (as
the view opens in its tiled size and then jumps to its natural
geometry). Because skipping the unshade might cause client problems and
doesn't eliminate the problem it sought to resolve, let's revert this.

This reverts commit 2e19bd4d5b.
2024-08-28 08:24:26 -04:00
tokyo4j
1f1bdad087 interactive: allow moving horizontally/vertically maximized window
Applies drag resistance unidirectionally for horizontally/vertically
maximized windows, allowing them to be dragged without being untiled
immediately. When the distance of cursor movement orthogonal to the
maximized direction exceeds <resistance><unMaximizeThreshold>.

While dragging a horizontally/vertically maximized window, edge/region
snapping is disabled to prevent unintentional snapping and overlays.

This commit also includes some refactoring to simplify the logic.
2024-08-26 20:30:22 +02:00
tokyo4j
2e19bd4d5b src/interactive.c: don't unshade when view is un-tiled by dragging
Unshading a maximized/tiled window at the start of interactive move
doesn't seem to be useful and caused flicker.
2024-08-26 20:30:22 +02:00
micko
3fa9810a36 README.md: update config files to six 2024-08-26 03:52:52 +02:00
01micko
72f59c32a2 docs: add description for new theme buttons 'shade' and 'desk' 2024-08-25 07:25:30 +02:00
Andrew J. Hesford
1bcaf8255f action: rename "omnipresent" button options for Openbox compatibility
- Mouse context "Omnipresent" -> "AllDesktops"
- Theme elements "window.*.button.omnipresent" -> "window.*.button.desk"
- Update documentation accordingly
2024-08-25 07:22:23 +02:00
Orfeas
dda47a5e14 action: make "FocusOutput" behave like "MoveToOutput" 2024-08-24 14:59:42 -04:00
Standreas
f2b6661db4 Fix typo in rc.xml.all 2024-08-24 10:16:42 -04:00
Andrew J. Hesford
b7bccc8026 ssd: add optional omnipresent button 2024-08-24 05:42:38 +02:00
Andrew J. Hesford
186a07be9b ssd: add optional shade button 2024-08-24 05:42:38 +02:00
tokyo4j
9f2eae672c ssd: fix incorrect cursor shape on titlebar corner without buttons
Before this commit, the backgrounds of titlebar corners were tagged as
LAB_SSD_PART_CORNER_TOP_{LEFT,RIGHT}, so the cursor shape on titlebar
corners without buttons were north-west or north-east.

This commit fixes it by tagging those backgrounds as
LAB_SSD_TITLEBAR_CORNER_{LEFT,RIGHT}.
2024-08-23 20:34:03 +02:00
Consolatis
23a9df0f30 common/buf.c: use 0 directly in vsnprintf()
This works around a wrong truncation warning in older GCC versions:
```
../src/common/buf.c:110:10: error: null destination pointer [-Werror=format-truncation=]
  110 |  int n = vsnprintf(NULL, size, fmt, ap)
```
2024-08-23 20:20:50 +02:00
tokyo4j
b667107d1a input: move <scrollFactor> to <libinput> section
This allows per-device configuration of scroll factor (e.g. setting
different scroll factors for mice and touchpads).
2024-08-23 16:20:56 +09:00
Johan Malm
228a74ca48
Merge pull request #2088 from xi/titlelayout
theme: implement titleLayout
2024-08-21 19:20:34 +01:00