Commit graph

2475 commits

Author SHA1 Message Date
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
droc12345
8fda9968e6
menu: add title theme options (#2097)
Add theme options `menu.title.text.color` and `menu.title.text.justify`.

Add font place MenuHeader: `<font place="MenuHeader">`

Add `Oblique` font style

```
<theme>
  <font>
    <slant>Oblique</slant>
  </font>
</theme>
```
2024-08-21 18:27:07 +01:00
Johan Malm
6564e1bc8d buf: add buf_add_fmt() 2024-08-21 16:09:44 +02:00
Tobias Bengfort
a28a3737b9 refactor ssd_titlebar_create 2024-08-20 23:04:10 +02:00
Tobias Bengfort
39ff873d5b ssd: apply title layout 2024-08-20 23:04:10 +02:00
Tobias Bengfort
9a252249c9 ssd: add titleLayout setting 2024-08-20 23:04:10 +02:00
Jens Peters
cd961b1ac1 action: add Enable/DisableTabletMouseEmulation
Useful for window rules.
2024-08-20 21:45:59 +01:00
Johan Malm
107d84cef9 scaled-font-buffer.c: initialize buffer to avoid bug waiting to happen 2024-08-20 18:01:22 +01:00
Johan Malm
9bc381d9e8 menu: use theme->menu_item_height instead of menu->item_height
...and set it in theme.c post_processing()
2024-08-20 18:01:22 +01:00
Johan Malm
0552c6b7f0 menu: support titles
...defined by `<separator label="">`.

Also add the theme option `menu.title.bg.color: #589bda`

The following will be added in separate commits
- menu.title.bg.border.color: #7cb6ec
- menu.title.text.color: #ffffff
- menu.title.text.justify: center
2024-08-20 18:01:22 +01:00
Johan Malm
a368bbee6a Add unit test for common/buf.c 2024-08-20 18:31:53 +02:00