]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
17 months agoicon-loader: also match desktop entries StartupWMClass
John Lindgren [Fri, 4 Oct 2024 18:05:31 +0000 (14:05 -0400)]
icon-loader: also match desktop entries StartupWMClass

GIMP for example sets its WM_CLASS to "gimp-2.10", which does not match
the "gimp.desktop" filename, but matches the StartupWMClass key listed
in it.

Thanks to @vyivel for the suggestion.

17 months agobuild: allow disabling icon when libsfdo is installed system-wide
tokyo4j [Tue, 1 Oct 2024 09:47:15 +0000 (18:47 +0900)]
build: allow disabling icon when libsfdo is installed system-wide

17 months agoicon-loader: add a log handler for sfdo messages
John Lindgren [Fri, 4 Oct 2024 02:22:47 +0000 (22:22 -0400)]
icon-loader: add a log handler for sfdo messages

Useful for debugging why an icon isn't being loaded.

v2: suggestions from @tokyo4j

17 months agotheme: draw hover overlay in the correct scale
tokyo4j [Thu, 3 Oct 2024 00:23:50 +0000 (09:23 +0900)]
theme: draw hover overlay in the correct scale

The hover icon buffer on which the hover overlay is draw can be larger
than the button size when a large non-hover icon is provided by user. In
this case, we should scale up all the coorinates that are used to draw
the hover overlay. Before this commit, corner radius and padding.width
are not scaled correctly.

This commit fixes it by scaling the cairo context with cairo_scale()
when drawing the hover overlay.

17 months agotheme: refactor rendering of rounded hover effect
tokyo4j [Thu, 3 Oct 2024 00:21:47 +0000 (09:21 +0900)]
theme: refactor rendering of rounded hover effect

17 months agossd: limit icon size to ~85% of window_button_width
John Lindgren [Thu, 3 Oct 2024 11:31:29 +0000 (07:31 -0400)]
ssd: limit icon size to ~85% of window_button_width

This ensures that the icon doesn't push right up to the window edge
(or left-aligned title) when using a large font or narrow button width.
In the default config (with 10pt font), it makes no difference since
the limiting factor on the icon size is the titlebar height anyway.

I spent way too much time over-thinking how to compute the padding.
I think 2px on each side is reasonable (and it should be equal on each
side), so window_button_width/10 (rounded down) should be fine.
Eventually the padding should probably be configurable anyway.

17 months agoTranslation updates from weblate
Weblate [Thu, 3 Oct 2024 08:01:22 +0000 (10:01 +0200)]
Translation updates from weblate

Co-authored-by: Dr. Ayhan YALÇINSOY <ayhanyalcinsoy@pisilinux.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/tr/
Translation: Labwc/labwc

17 months agodata: disable Inhibit D-BUS interface in xdg-portals configuration (#2205)
Jens Peters [Wed, 2 Oct 2024 20:32:47 +0000 (22:32 +0200)]
data: disable Inhibit D-BUS interface in xdg-portals configuration (#2205)

The GTK xdg-portal implementation, which is used as
the default behind the wlr xdg-portal implementation,
exposes the Inhibit interface even on a non-Gnome
session. Unfortunately this D-BUS interface does not
work on labwc.
By explicitly disabling this interface, firefox and may be
other applications are not tricked into using the
xdg-portal interface but use the Wayland IdleInhibit
protocol instead which labwc supports.

17 months agocosmic-workspaces: fix menu.c
Johan Malm [Tue, 1 Oct 2024 20:41:36 +0000 (21:41 +0100)]
cosmic-workspaces: fix menu.c

17 months agoAdd labwc to XDG_CURRENT_DESKTOP to support a portals.conf (#1716)
Rick Calixte [Tue, 1 Oct 2024 20:33:45 +0000 (16:33 -0400)]
Add labwc to XDG_CURRENT_DESKTOP to support a portals.conf (#1716)

The previous `UseIn` key was deprecated in xdg-desktop-portal 1.17/1.18.
It has been superceded by the portals.conf structure so that each
desktop can configure the precise desired structure for portals. In
addition, support was added to the Desktop Entry Specifications to
support a `DesktopNames` key that login managers will use to set
XDG_CURRENT_DESKTOP.

* [portals.conf
  Documentation](https://github.com/flatpak/xdg-desktop-portal/blob/main/doc/portals.conf.rst.in)
* [Example
  sway-portals.conf](https://salsa.debian.org/swaywm-team/sway/-/blob/debian/sid/debian/sway-portals.conf)
* [Desktop Entry
  Specifications](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)

Ref: flatpak/xdg-desktop-portal#955

17 months agoMerge pull request #2030 from Consolatis/wip/cosmic_workspaces
Johan Malm [Tue, 1 Oct 2024 20:31:04 +0000 (21:31 +0100)]
Merge pull request #2030 from Consolatis/wip/cosmic_workspaces

Initial implementation of cosmic-workspace-unstable-v1

17 months agocursor: prevent Drag mousebinds from running without button press
tokyo4j [Mon, 23 Sep 2024 19:49:08 +0000 (04:49 +0900)]
cursor: prevent Drag mousebinds from running without button press

For `Drag` mousebinds, `pressed_in_context` is set by
`cursor_process_button_press()` and cleared by `cursor_process_motion()`
which runs actions bound to them. However, when `cursor_process_motion()`
is called while interactive move/resize, it doesn't clear
`pressed_in_context` due to the early-return and the `Drag` mousebinds are
unexpectedly executed on another call to `cursor_process_motion()` after
the interactive move/resize is finished by button release, even when the
button is not pressed.

So this commit fixes it by always clearing `pressed_in_context` on button
releases.

17 months agoxdg: try to handle slow un-maximize with empty natural geometry better
John Lindgren [Tue, 1 Oct 2024 14:16:29 +0000 (10:16 -0400)]
xdg: try to handle slow un-maximize with empty natural geometry better

In the case of an initially-maximized view which is taking a long time
to un-maximize (seen for example with Thunderbird on slow machines), we
may end up in handle_configure_timeout() with an empty pending geometry.
In that case we have no great options (we can't center the view since we
don't know the un-maximized size yet), so set a fallback position.

v2: check wlr_box_empty() before comparing pending and current

Fixes: #2191
17 months agodoc: update default value of <theme><titlebar><layout>
tokyo4j [Mon, 30 Sep 2024 12:02:28 +0000 (21:02 +0900)]
doc: update default value of <theme><titlebar><layout>

17 months agoicon-loader: add a new loader for XPM icons, used by many legacy X11 apps
John Lindgren [Mon, 30 Sep 2024 07:41:25 +0000 (03:41 -0400)]
icon-loader: add a new loader for XPM icons, used by many legacy X11 apps

Adapted from gdk-pixbuf, see the original at:

  https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/blob/master/gdk-pixbuf/io-xpm.c

rgb.txt is from X.org, see:

  https://gitlab.freedesktop.org/xorg/app/rgb/-/blob/master/rgb.txt

Differences from the gdk-pixbuf version:

- GdkPixbuf replaced with struct lab_data_buffer
- Progressive and in-memory loading code removed
- Two functions that had separate BSD copyright rewritten
- Stores colors as ARGB32 earlier in the decoding process for efficiency
- Limited to 1024x1024 px and 1024 colors to prevent abuse
- Uses struct buf to build strings, in place of manual g_new/g_realloc
- Uses xzalloc/xznew_n for other memory allocations
- Uses g_strlcpy in place of banned strcpy/strncpy/strncat
- Uses standard C types (int, bool, etc.) in place of the GLib ones
- Follows labwc coding style (whitespace, braces, letter case, etc.)
- Et cetera ...

v2: add Perl fixes from @domo141

17 months agoicon-loader: match more application icons via fuzzy match
John Lindgren [Mon, 30 Sep 2024 04:24:13 +0000 (00:24 -0400)]
icon-loader: match more application icons via fuzzy match

Add fallback logic to match reverse-URL .desktop file names when
the app_id is just the base name (e.g. "thunderbird" ->
org.mozilla.Thunderbird.desktop).

17 months agoTranslation updates from weblate
Weblate [Mon, 30 Sep 2024 20:01:21 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Eric Migeon <weblate.tilux@spamgourmet.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/fr/
Translation: Labwc/labwc

17 months agossd: also add spacing between innermost button and title
John Lindgren [Mon, 30 Sep 2024 16:27:19 +0000 (12:27 -0400)]
ssd: also add spacing between innermost button and title

Currently, left-aligned title text gets pushed right up to the window
icon with no spacing at all, which looks bad IMO.

17 months agoxdg: fix de-synced SSD when shrinking Thunderbird window
tokyo4j [Sun, 29 Sep 2024 19:37:05 +0000 (04:37 +0900)]
xdg: fix de-synced SSD when shrinking Thunderbird window

On a slow mechine or heavy load, we sometimes see de-synced SSD with
Thunderbird windows when shrinking it. Here's how it happened:

1. Labwc sends a configure event.
2. The configure event timeouts and labwc resets view->{pending,current}
   with the old geometry.
3. Thunderbird updates the toplevel window geometry and the toplevel
   surface size, but not the subsurface size. Then it sends a commit.
4. Since now the committed window geometry and view->pending are
   different, the workaround for Qt apps is applied and the whole surface
   extent is set to view->current. Thus SSD stays in the old geometry.
5. Thunderbird finally updates the subsurface size.

So, this commit fixes this conflict between Thunderbird and the workaround
for Qt apps by using the toplevel surface size instead of the whole
surface extent to update view->current.

17 months agoicon-loader: support absolute icon names
Johan Malm [Sat, 28 Sep 2024 10:21:19 +0000 (11:21 +0100)]
icon-loader: support absolute icon names

17 months agoicon-loader: refactor in preparation for supporting absolute icon names
Johan Malm [Sat, 28 Sep 2024 10:20:28 +0000 (11:20 +0100)]
icon-loader: refactor in preparation for supporting absolute icon names

No functional change intended.

17 months agoci: add libsfdo-devel for Void
Johan Malm [Fri, 27 Sep 2024 20:42:37 +0000 (21:42 +0100)]
ci: add libsfdo-devel for Void

17 months agoTranslation updates from weblate
Weblate [Wed, 25 Sep 2024 20:01:21 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Giannis Antypas <gianni.antypas@gmail.com>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/el/
Translation: Labwc/labwc

17 months agossd: fix crash on app_id updates while the app is in fullscreen
tokyo4j [Wed, 25 Sep 2024 12:27:43 +0000 (21:27 +0900)]
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()`.

17 months agossd: support window icons
tokyo4j [Fri, 6 Sep 2024 08:00:40 +0000 (17:00 +0900)]
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.

17 months agoaction: implicitely unmaximize when unsnapping
Jens Peters [Tue, 24 Sep 2024 04:39:21 +0000 (06:39 +0200)]
action: implicitely unmaximize when unsnapping

Co-authored-by: tokyo4j <hrak1529@gmail.com>
17 months agoaction: add UnSnap action
Jens Peters [Sat, 21 Sep 2024 13:54:30 +0000 (15:54 +0200)]
action: add UnSnap action

Same untiling behavior as ToggleSnapToEdge/Region,
but unconditionally.

Co-authored-by: tokyo4j <hrak1529@gmail.com>
17 months agoaction: add ToggleSnapToEdge/Region actions
Jens Peters [Sat, 21 Sep 2024 13:53:05 +0000 (15:53 +0200)]
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>
17 months agoview: expose view_apply_natural_geometry()
Jens Peters [Sat, 21 Sep 2024 13:51:37 +0000 (15:51 +0200)]
view: expose view_apply_natural_geometry()

Co-authored-by: tokyo4j <hrak1529@gmail.com>
17 months agoci: disable debian build checks until dependencies can be met
Johan Malm [Tue, 24 Sep 2024 19:22:25 +0000 (20:22 +0100)]
ci: disable debian build checks until dependencies can be met

17 months agotheme: fix incorrect default for <titlebar><showTitle>
Johan Malm [Tue, 24 Sep 2024 18:51:58 +0000 (19:51 +0100)]
theme: fix incorrect default for <titlebar><showTitle>

17 months agoTranslation updates from weblate
Weblate [Tue, 24 Sep 2024 08:01:21 +0000 (10:01 +0200)]
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

17 months agoDon't detect edge-resizes in configure timeout
David Turner [Mon, 23 Sep 2024 15:17:22 +0000 (16:17 +0100)]
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

17 months agoci: use -Wno-expansion-to-defined to avoid Arch CI error
Johan Malm [Mon, 23 Sep 2024 21:14:22 +0000 (22:14 +0100)]
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

17 months agoTranslation updates from weblate
Weblate [Mon, 23 Sep 2024 20:01:21 +0000 (22:01 +0200)]
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

17 months agotheme: finish titleLayout implementation (#2150)
Johan Malm [Mon, 23 Sep 2024 18:17:12 +0000 (19:17 +0100)]
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

17 months agoTranslation updates from weblate
Weblate [Sat, 21 Sep 2024 20:01:21 +0000 (22:01 +0200)]
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

17 months agoTranslation updates from weblate
Weblate [Thu, 19 Sep 2024 20:01:23 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/
Translation: Labwc/labwc

17 months agoxdg: handle show_window_menu requests
tokyo4j [Mon, 16 Sep 2024 15:32:02 +0000 (00:32 +0900)]
xdg: handle show_window_menu requests

17 months agoxdg: don't always adjust the window size before configure
tokyo4j [Sat, 21 Sep 2024 07:16:35 +0000 (16:16 +0900)]
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.

17 months agoRefactor the logic of placing client-menu with ShowMenu action
tokyo4j [Fri, 20 Sep 2024 16:11:27 +0000 (01:11 +0900)]
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.

17 months agodocs: fix documentation of "atCursor" for dynamic titlebar layout
tokyo4j [Sat, 21 Sep 2024 11:12:00 +0000 (20:12 +0900)]
docs: fix documentation of "atCursor" for dynamic titlebar layout

17 months agodocs/rc.xml.all: add missing atCursor="no"
tokyo4j [Mon, 26 Aug 2024 09:29:49 +0000 (18:29 +0900)]
docs/rc.xml.all: add missing atCursor="no"

17 months agoclient list combines fix empty title
Droc [Thu, 19 Sep 2024 19:53:12 +0000 (14:53 -0500)]
client list combines fix empty title

this adds a check for title being null or empty as well as
existence of toplevel.handle

17 months agolabwc.pot: update translation template for 71b2b5a
01micko [Thu, 19 Sep 2024 11:41:35 +0000 (21:41 +1000)]
labwc.pot: update translation template for 71b2b5a

fixes #2157

17 months agoclient send to menu
Droc [Thu, 19 Sep 2024 00:01:28 +0000 (19:01 -0500)]
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

17 months agoclient list combined menu examples
Droc [Wed, 18 Sep 2024 21:50:01 +0000 (16:50 -0500)]
client list combined menu examples

17 months agoclient list combined menu fix
Droc [Wed, 18 Sep 2024 17:08:10 +0000 (12:08 -0500)]
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.

17 months agomenu: support client-list-combined-menu
Droc [Tue, 17 Sep 2024 11:52:10 +0000 (06:52 -0500)]
menu: support client-list-combined-menu

...showing windows across all workspaces.

<action name="ShowMenu" menu="client-list-combined-menu"/>

17 months agoNEWS.md: interim update
Johan Malm [Thu, 12 Sep 2024 20:14:10 +0000 (21:14 +0100)]
NEWS.md: interim update

17 months agoaction: open the client menu underneath the window menu button
Jens Peters [Sun, 15 Sep 2024 20:29:05 +0000 (22:29 +0200)]
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.

17 months agotheme: round the hover effect along the window border
tokyo4j [Sun, 15 Sep 2024 15:16:30 +0000 (00:16 +0900)]
theme: round the hover effect along the window border

17 months agotheme: compensate the hover corner radius with padding
Jens Peters [Wed, 11 Sep 2024 15:52:26 +0000 (17:52 +0200)]
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.

17 months agotheme: add circle button hover effect (#2127)
Jens Peters [Mon, 9 Sep 2024 15:44:03 +0000 (17:44 +0200)]
theme: add circle button hover effect (#2127)

17 months agotheme: ensure positive values (#2127)
Jens Peters [Tue, 10 Sep 2024 19:15:28 +0000 (21:15 +0200)]
theme: ensure positive values (#2127)

Clamp invalid configuration values to zero.

17 months agotheme: add button padding and spacing (#2127)
Jens Peters [Mon, 9 Sep 2024 15:43:38 +0000 (17:43 +0200)]
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.

18 months agoAdd position arguments for menus
Droc [Thu, 5 Sep 2024 12:52:23 +0000 (07:52 -0500)]
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.

18 months agoTranslation updates from weblate
Weblate [Sat, 24 Aug 2024 20:01:18 +0000 (22:01 +0200)]
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

18 months agossd: allow ssd to be smaller than minimal size by hiding buttons
tokyo4j [Sun, 25 Aug 2024 07:33:41 +0000 (16:33 +0900)]
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.

18 months agoRevert "src/interactive.c: don't unshade when view is un-tiled by dragging"
Andrew J. Hesford [Tue, 27 Aug 2024 14:10:53 +0000 (10:10 -0400)]
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 2e19bd4d5b3c67c27d13be24d41a0ea9ba2f1626.

18 months agointeractive: allow moving horizontally/vertically maximized window
tokyo4j [Wed, 7 Aug 2024 00:17:25 +0000 (09:17 +0900)]
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.

18 months agosrc/interactive.c: don't unshade when view is un-tiled by dragging
tokyo4j [Wed, 7 Aug 2024 03:45:23 +0000 (12:45 +0900)]
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.

18 months agoREADME.md: update config files to six
micko [Mon, 26 Aug 2024 00:16:43 +0000 (10:16 +1000)]
README.md: update config files to six

18 months agodocs: add description for new theme buttons 'shade' and 'desk'
01micko [Sun, 25 Aug 2024 04:47:00 +0000 (14:47 +1000)]
docs: add description for new theme buttons 'shade' and 'desk'

18 months agoaction: rename "omnipresent" button options for Openbox compatibility
Andrew J. Hesford [Sun, 25 Aug 2024 04:00:24 +0000 (00:00 -0400)]
action: rename "omnipresent" button options for Openbox compatibility

- Mouse context "Omnipresent" -> "AllDesktops"
- Theme elements "window.*.button.omnipresent" -> "window.*.button.desk"
- Update documentation accordingly

18 months agoaction: make "FocusOutput" behave like "MoveToOutput"
Orfeas [Wed, 21 Aug 2024 04:38:44 +0000 (07:38 +0300)]
action: make "FocusOutput" behave like "MoveToOutput"

18 months agoFix typo in rc.xml.all
Standreas [Sat, 24 Aug 2024 13:42:10 +0000 (15:42 +0200)]
Fix typo in rc.xml.all

18 months agossd: add optional omnipresent button
Andrew J. Hesford [Fri, 23 Aug 2024 16:45:14 +0000 (12:45 -0400)]
ssd: add optional omnipresent button

18 months agossd: add optional shade button
Andrew J. Hesford [Thu, 22 Aug 2024 20:27:24 +0000 (16:27 -0400)]
ssd: add optional shade button

18 months agossd: fix incorrect cursor shape on titlebar corner without buttons
tokyo4j [Fri, 23 Aug 2024 04:05:13 +0000 (13:05 +0900)]
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}.

18 months agocommon/buf.c: use 0 directly in vsnprintf()
Consolatis [Fri, 23 Aug 2024 18:09:47 +0000 (20:09 +0200)]
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)
```

18 months agoinput: move <scrollFactor> to <libinput> section
tokyo4j [Thu, 8 Aug 2024 08:29:43 +0000 (17:29 +0900)]
input: move <scrollFactor> to <libinput> section

This allows per-device configuration of scroll factor (e.g. setting
different scroll factors for mice and touchpads).

18 months agoMerge pull request #2088 from xi/titlelayout
Johan Malm [Wed, 21 Aug 2024 18:20:34 +0000 (19:20 +0100)]
Merge pull request #2088 from xi/titlelayout

theme: implement titleLayout

18 months agomenu: add title theme options (#2097)
droc12345 [Wed, 21 Aug 2024 17:27:07 +0000 (12:27 -0500)]
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>
```

18 months agobuf: add buf_add_fmt()
Johan Malm [Mon, 19 Aug 2024 20:22:50 +0000 (21:22 +0100)]
buf: add buf_add_fmt()

18 months agorefactor ssd_titlebar_create
Tobias Bengfort [Sun, 18 Aug 2024 08:20:24 +0000 (10:20 +0200)]
refactor ssd_titlebar_create

18 months agossd: apply title layout
Tobias Bengfort [Sun, 18 Aug 2024 08:49:18 +0000 (10:49 +0200)]
ssd: apply title layout

18 months agossd: add titleLayout setting
Tobias Bengfort [Sat, 17 Aug 2024 12:45:25 +0000 (14:45 +0200)]
ssd: add titleLayout setting

18 months agoaction: add Enable/DisableTabletMouseEmulation
Jens Peters [Sun, 18 Aug 2024 14:09:39 +0000 (16:09 +0200)]
action: add Enable/DisableTabletMouseEmulation

Useful for window rules.

18 months agoscaled-font-buffer.c: initialize `buffer` to avoid bug waiting to happen
Johan Malm [Sat, 17 Aug 2024 12:41:10 +0000 (13:41 +0100)]
scaled-font-buffer.c: initialize `buffer` to avoid bug waiting to happen

18 months agomenu: use theme->menu_item_height instead of menu->item_height
Johan Malm [Thu, 15 Aug 2024 19:54:49 +0000 (20:54 +0100)]
menu: use theme->menu_item_height instead of menu->item_height

...and set it in theme.c post_processing()

18 months agomenu: support titles
Johan Malm [Thu, 9 May 2024 20:20:15 +0000 (21:20 +0100)]
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

18 months agoAdd unit test for common/buf.c
Johan Malm [Sat, 23 Sep 2023 14:07:25 +0000 (15:07 +0100)]
Add unit test for common/buf.c

18 months agosrc/menu: prevent delayed pipe menu response on item destroy (#2094)
Consolatis [Tue, 20 Aug 2024 16:09:17 +0000 (18:09 +0200)]
src/menu: prevent delayed pipe menu response on item destroy (#2094)

Without this patch we would happily access `pipe_ctx->item`
members even if the item had been destroyed in the meantime.

18 months agoTranslation updates from weblate
Weblate [Sun, 18 Aug 2024 20:01:17 +0000 (22:01 +0200)]
Translation updates from weblate

Co-authored-by: Peter Jespersen <flywheel@illogical.dk>
Translate-URL: https://translate.lxqt-project.org/projects/labwc/labwc/da/
Translation: Labwc/labwc

18 months agoTranslation updates from weblate
Weblate [Sat, 17 Aug 2024 20:31:07 +0000 (22:31 +0200)]
Translation updates from weblate

Co-authored-by: Peter Jespersen <flywheel@illogical.dk>
18 months agossd: do not draw background for individual buttons
Tobias Bengfort [Sat, 17 Aug 2024 12:46:35 +0000 (14:46 +0200)]
ssd: do not draw background for individual buttons

18 months agooutput: set 'labwc' as app_id and title for nested outputs
Consolatis [Wed, 7 Aug 2024 21:28:30 +0000 (23:28 +0200)]
output: set 'labwc' as app_id and title for nested outputs

18 months agoxwayland: remove dissociate work-around
Johan Malm [Mon, 12 Aug 2024 21:07:53 +0000 (22:07 +0100)]
xwayland: remove dissociate work-around

...to cope with pre-wlroots-0.18.0 behaviour resulting in dissociate
events being emitted without a prior associate one.

18 months agoxdg: destroy foreign toplevel handle on unmap
tokyo4j [Tue, 13 Aug 2024 01:02:46 +0000 (10:02 +0900)]
xdg: destroy foreign toplevel handle on unmap

xdg-shell protocol says:
    All active operations (e.g., move, resize) are canceled and all
    attributes (e.g. title, state, stacking, ...) are discarded for an
    xdg_toplevel surface when it is unmapped.
So, when a xdg-toplevel is unmapped (not minimized), the corresponding
foreign handler should be destroyed to reset attributes.

18 months agoxwayland: sync foreign-toplevel and associated outputs on re-map
tokyo4j [Tue, 13 Aug 2024 01:01:49 +0000 (10:01 +0900)]
xwayland: sync foreign-toplevel and associated outputs on re-map

Fixes a bug that `zwlr_foreign_toplevel_handle_v1::output_enter` is not
sent when a xwayland surface is re-mapped (e.g. opening Slack desktop
app when it's running in background).

18 months agobuild: bump version to 0.8.0
Johan Malm [Fri, 16 Aug 2024 15:38:54 +0000 (16:38 +0100)]
build: bump version to 0.8.0

18 months agoNEWS.md: update notes for 0.8.0
Johan Malm [Thu, 15 Aug 2024 20:16:48 +0000 (21:16 +0100)]
NEWS.md: update notes for 0.8.0

18 months agoscene-helpers: use pending_commit_damage, chases wlr!4253
Consolatis [Wed, 14 Aug 2024 18:17:50 +0000 (20:17 +0200)]
scene-helpers: use pending_commit_damage, chases wlr!4253

Using the output damage_ring for early out will break VRR in
direct scanout mode. The reason being that the damage_ring
will be completely ignored in that mode so we need to check
`output->pending_commit_damage` instead. This matches with
what wlroots has been doing since [0] and it was missed in
the initial port to wlroots 0.18.x.

However, that would then break the magnifier which only adds
its damage to the damage ring. After some discussion with
the wlroots devs we came up with a solution that should work
for both, wlroots 0.18.0 and when [1] is backported to 0.18.1.

Note that even with this PR, VRR in direct scanout mode is
broken in 0.18.0 from the wlroots side and will be fixed once
[1] is backported to the 0.18 branch and 0.18.1 is released.

Fixes: #2078
[0] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4253
[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4753

18 months agoinput: ensure that our own tablet structs are created
Jens Peters [Sat, 10 Aug 2024 05:05:05 +0000 (07:05 +0200)]
input: ensure that our own tablet structs are created

18 months agoinput: move cursor event listeners from tablet to seat
Jens Peters [Fri, 9 Aug 2024 07:25:00 +0000 (09:25 +0200)]
input: move cursor event listeners from tablet to seat

Otherwise we would subscribe multiple times to the
same event when having multiple tablets.

18 months agoinput: use CONNECT_SIGNAL macro
Jens Peters [Fri, 9 Aug 2024 07:22:28 +0000 (09:22 +0200)]
input: use CONNECT_SIGNAL macro

18 months agoxdg: fix error when launching windowed Chromium
tokyo4j [Sun, 21 Jul 2024 08:09:17 +0000 (17:09 +0900)]
xdg: fix error when launching windowed Chromium

Chromium sends 2 commits before the commit with a buffer attached. We
were just checking `wlr_box_empty(&view->pending)` to handle the cases
where an initially maximized/fullscreen client is windowed, but that
check was also returning true on the 2nd commit from Chromium, resulting
in an error message: "view has empty geometry, not centering".

18 months agoxdg-activation: temporarily disable source surface verification
tokyo4j [Fri, 9 Aug 2024 06:56:26 +0000 (15:56 +0900)]
xdg-activation: temporarily disable source surface verification

71451173 validates the xdg-activation token more strictly by verifying
the source surface attached to the token. That  improves the security by
preventing arbitrary focus-stealing.

However, not all clients attach a right source surface to the token or
use the received token for activation. For example, when a notification
client requests thunderbird to activate its window, thunderbird doesn't
use the token passed by the notification client and instead use their own
token, thus the activation is rejected as the surface attached to the
token is not focused.

We will add options to configure the policy for activation requests or
implement urgency hint in some way in the future and reland the source
surface verification.

18 months agokeyboard: fix bug with empty XKB_DEFAULT_LAYOUT
Johan Malm [Thu, 8 Aug 2024 19:14:23 +0000 (20:14 +0100)]
keyboard: fix bug with empty XKB_DEFAULT_LAYOUT

With XKB_DEFAULT_LAYOUT= (set to empty rather than unset) the keyboard
just does not work.

Ref: https://github.com/labwc/labwc-tweaks/issues/89