]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
16 months agotheme: add window.titlebar.padding.{width,height}
Johan Malm [Tue, 8 Oct 2024 16:52:57 +0000 (17:52 +0100)]
theme: add window.titlebar.padding.{width,height}

...to replace padding.{width,height} to minimize breaking changes with the
visual appearance of the titlebar.

With the diverging labwc specification for the titlebar (listed below)
we have to choose between (a) not supporting the padding.{width,height}
option which exist in many extant Openbox themes to keep titlebar height
(almost) the same; or (b) making the allocated button areas much smaller
and not keeping the default hover going all the way to the edges. All in
all it just seems a lot simpler and cleaner to break this link to the
openbox spec.

Examples of previous change driving the requirement for this change:

- SVG and PNG support which often results in large icons with hover
  effects.
- Theme option window.button.{height,width}
- Larger default areas for icons (26x26)

In way of an example, Numix theme sets a padding.height of 6 which would
have resulted in a titlebar 12px taller without this change.

16 months agotheme: change padding.height default to 0
Johan Malm [Sun, 29 Sep 2024 17:32:51 +0000 (18:32 +0100)]
theme: change padding.height default to 0

...because now that window.button.height determines the height of button
hover effect the visible appearance of the titlebar will change unless
we reduce the padding to zero.

Backward compatibility notice: If a users theme sets padding.height to a
value greater than zero, the titlebar will be taller compared with
openbox. This can be fixed by either reducing window.button.height or
overriding padding.height

16 months agotheme: derive titlebar height from its objects
Johan Malm [Sun, 29 Sep 2024 17:25:23 +0000 (18:25 +0100)]
theme: derive titlebar height from its objects

...including the new window.button.height

16 months agotheme: remove titlebar.height option
Johan Malm [Sun, 29 Sep 2024 17:22:47 +0000 (18:22 +0100)]
theme: remove titlebar.height option

This theme setting does not exist in Openbox spec and has just been an
additional 'knob' to tweak the height which is otherwise derived from the
sizes of the objects within it plus padding.

16 months agotheme: add window.button.height
Johan Malm [Fri, 20 Sep 2024 19:59:01 +0000 (20:59 +0100)]
theme: add window.button.height

window.button.{height,width} determine the space allocated for buttons.
Buttons can be smaller than this size and will then just be center aligned
within the allocated space. However, buttons will be clamped at this size
to prevent them from going outside of the allocated space.

16 months agoxdg-shell: fix popup on wrong output
Johan Malm [Sun, 6 Oct 2024 18:51:59 +0000 (19:51 +0100)]
xdg-shell: fix popup on wrong output

16 months agoMerge pull request #2225 from jlindgren90/icon-scaling
Johan Malm [Mon, 7 Oct 2024 21:16:34 +0000 (22:16 +0100)]
Merge pull request #2225 from jlindgren90/icon-scaling

Improve icon display especially at larger output scales

17 months agoicon-loader: update PNG and XPM loaders to use new buffer helper
John Lindgren [Mon, 7 Oct 2024 02:38:03 +0000 (22:38 -0400)]
icon-loader: update PNG and XPM loaders to use new buffer helper

17 months agobuffer: add buffer_convert_cairo_surface_for_icon()
John Lindgren [Mon, 7 Oct 2024 02:28:33 +0000 (22:28 -0400)]
buffer: add buffer_convert_cairo_surface_for_icon()

Which handles:
 - conversion from other pixel formats to ARGB32
 - setting the logical size to the desired display size
 - downscaling very large images using CAIRO_FILTER_GOOD

17 months agocommon/box: add box_fit_within()
John Lindgren [Sat, 5 Oct 2024 13:45:48 +0000 (09:45 -0400)]
common/box: add box_fit_within()

Factor out common math from ssd's get_scale_box() for use elsewhere.

17 months agossd: respect logical size when displaying window icon
John Lindgren [Mon, 7 Oct 2024 01:29:40 +0000 (21:29 -0400)]
ssd: respect logical size when displaying window icon

get_scale_box() was using the raw pixel size of the icon buffer for
layout, which caused the icon to be incorrectly scaled up if the buffer
scale was >1.

17 months agoicon-loader: load SVG icons at max scale of any usable output
John Lindgren [Mon, 7 Oct 2024 01:24:34 +0000 (21:24 -0400)]
icon-loader: load SVG icons at max scale of any usable output

- Add a new function to get the maximum scale of all usable outputs
- Pass the maximum output scale through to img_svg_load(), which
  ultimately calls cairo_surface_set_device_scale() before rendering

17 months agoxdg: take into account minimum window size for resizing (#2221)
Hiroaki Yamamoto [Sun, 6 Oct 2024 15:58:54 +0000 (00:58 +0900)]
xdg: take into account minimum window size for resizing (#2221)

This is especially relavant for <resize drawContents="no">.

17 months agobuffer: reduce unnecessary painting to new cairo surfaces
John Lindgren [Sun, 6 Oct 2024 05:42:54 +0000 (01:42 -0400)]
buffer: reduce unnecessary painting to new cairo surfaces

Add buffer_adopt_cairo_surface(), which allows wrapping an existing
cairo image surface in a struct lab_data_buffer. This is useful when
loading PNGs since most will be loaded as ARGB32 already.

Fix a memory leak in the non-ARGB32 PNG case, where we do still need to
paint to a new image surface -- we were leaking the original surface.

Eliminate an unnecessary temporary image surface in SVG loading and just
render the SVG to the image surface held by the lab_data_buffer.

I also cleaned up and clarified the buffer API a bit:

- Add a pointer to the held cairo_surface_t (so we can still access it
  if there is no cairo_t).
- Remove the free_on_destroy bool (it was always true).
- Rename unscaled_width/height to logical_width/height and add an
  explanatory comment. It was unclear what "unscaled" meant.
- Rename buffer_create_wrap() to buffer_create_from_data().

This is laying groundwork for some more icon fixes I am working on
(making sure icons are loaded and rendered at the correct scale).

17 months agotheme: fix loading *-inactive.svg icons
tokyo4j [Sun, 6 Oct 2024 11:49:21 +0000 (20:49 +0900)]
theme: fix loading *-inactive.svg icons

17 months agoicon-loader: fix a few more missing icons
John Lindgren [Fri, 4 Oct 2024 21:31:58 +0000 (17:31 -0400)]
icon-loader: fix a few more missing icons

By:
- stripping extensions from relative icon filenames (for example,
  gdmap.desktop has "Icon=gdmap_icon.png")
- using the WM_CLASS "instance" rather than "class" string, which
  is usually the same but lowercase

17 months agotheme: refine the management of corner buttons
tokyo4j [Fri, 4 Oct 2024 06:27:25 +0000 (15:27 +0900)]
theme: refine the management of corner buttons

- The builtin hover effect is now unrounded when the window is tiled.
- All the corner button icons including ones provided by the user are
  now rounded when the window is not tiled.
- Fixed the bug that the window menu button as a fallback of the window
  icon is not correctly rounded.

17 months agoxdg: fix crash on actions from menu opened by show_window_menu requests
tokyo4j [Fri, 4 Oct 2024 07:44:55 +0000 (16:44 +0900)]
xdg: fix crash on actions from menu opened by show_window_menu requests

Also removed a redundant line in show_menu() in action.c.

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