]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
3 years agocursor: Factor out cursor_update_common() and fix some glitches
John Lindgren [Mon, 12 Sep 2022 17:14:18 +0000 (13:14 -0400)]
cursor: Factor out cursor_update_common() and fix some glitches

Fix a couple of glitches seen when exiting interactive move/resize:

 - Cursor briefly set to left_ptr rather than the correct cursor image
 - Cursor not updated if the view being moved/resized is destroyed

Also make sure to exit interactive mode if the view is going fullscreen
(labwc gets very confused otherwise).

Code changes in detail:

 - Factor out set_server_cursor() which will set the correct cursor
   image for non-client areas (either XCURSOR_DEFAULT or one of the
   resize cursors).
 - Unify the logic from cursor_rebase() and process_cursor_motion by
   factoring out cursor_update_common().  This corrects some logic
   discrepancies between the two, which should be a good thing(TM).
 - Remove the extra cursor_set(XCURSOR_DEFAULT) from interactive_end()
   and instead rely on cursor_update_focus() to do the right thing.
 - Simplify cursor_button() by just calling interactive_end() when we
   want to exit interactive mode.
 - Call cursor_update_focus() from view_destroy() if the view had mouse
   focus or was being interactively moved/resized.

v2: Eliminate force_reenter parameters and figure out automatically
    when we need to re-enter the surface.
v3: Rename wlseat -> wlr_seat.
v4: Simplify client/server cursor logic.

3 years agorcxml.c: enable tap be default on non-touch devices
Johan Malm [Fri, 9 Sep 2022 20:51:08 +0000 (21:51 +0100)]
rcxml.c: enable tap be default on non-touch devices

Some trackpads do not honour tap if we only enable it on touch-devices.

3 years agocursor: Handle missing cursor theme
Consolatis [Sat, 10 Sep 2022 21:53:35 +0000 (23:53 +0200)]
cursor: Handle missing cursor theme

Temporary fix for #246

This should be reverted once wlroots MR !3651 is merged.

3 years agocursor: Don't load cursor theme in server_init()
Consolatis [Sat, 10 Sep 2022 22:05:30 +0000 (00:05 +0200)]
cursor: Don't load cursor theme in server_init()

We are already doing that in seat_init() -> cursor_init()

3 years agocursor: Prevent setting the same cursor image twice
Consolatis [Sat, 10 Sep 2022 17:48:49 +0000 (19:48 +0200)]
cursor: Prevent setting the same cursor image twice

Possibly fixes #512

Reported-by: @Flrian
3 years agocursor: Prevent resetting cursor icon during Move or Resize
Consolatis [Sat, 10 Sep 2022 17:19:02 +0000 (19:19 +0200)]
cursor: Prevent resetting cursor icon during Move or Resize

Reported-by: @Flrian
3 years agocursor: Allow re-enter for cursor_update_focus()
Consolatis [Sun, 11 Sep 2022 05:08:28 +0000 (07:08 +0200)]
cursor: Allow re-enter for cursor_update_focus()

This allows forcing an application to re-set their desired cursor image.

3 years agoMerge pull request #531 from jlindgren90/titlebar-fixes
Johan Malm [Fri, 9 Sep 2022 20:35:30 +0000 (21:35 +0100)]
Merge pull request #531 from jlindgren90/titlebar-fixes

Titlebar fixes

3 years agossd: Make ssd_get_part_type() work for corner buttons
John Lindgren [Thu, 8 Sep 2022 17:16:19 +0000 (13:16 -0400)]
ssd: Make ssd_get_part_type() work for corner buttons

Corner buttons (WINDOW_MENU and CLOSE) are one more level down in
the scene-tree (see add_scene_button_corner() in ssd_part.c).

This fixes a minor issue where, when right-clicking on the CLOSE
button, the client-menu would be displayed in the wrong location.

3 years agoconfig: Redefine Title context to include blank areas of Titlebar
John Lindgren [Thu, 8 Sep 2022 17:20:48 +0000 (13:20 -0400)]
config: Redefine Title context to include blank areas of Titlebar

... and use Title for the Drag (Move) and DoubleClick (Maximize)
titlebar actions, which are unexpected when the cursor is over one
of the window buttons.

3 years agoMerge pull request #523 from jlindgren90/unmanaged-cursor-focus
Johan Malm [Fri, 9 Sep 2022 14:48:14 +0000 (15:48 +0100)]
Merge pull request #523 from jlindgren90/unmanaged-cursor-focus

cursor: Update focus when unmanaged surfaces are mapped/unmapped

3 years agoMerge pull request #526 from Consolatis/issue/317_gimp_remap
Johan Malm [Fri, 9 Sep 2022 14:32:14 +0000 (15:32 +0100)]
Merge pull request #526 from Consolatis/issue/317_gimp_remap

xwayland: Keep view->xwayland_surface and view->surface in sync

3 years agointeractive: Don't write to view->x/y/w/h directly
John Lindgren [Thu, 8 Sep 2022 15:50:40 +0000 (11:50 -0400)]
interactive: Don't write to view->x/y/w/h directly

Otherwise, the scene-graph isn't updated when calling
view->impl->configure(), and the view ends up in a weird
half-maximized state.

3 years agocursor: Update cursor focus on scroll events
Consolatis [Wed, 7 Sep 2022 23:30:29 +0000 (01:30 +0200)]
cursor: Update cursor focus on scroll events

3 years agocursor: Make cursor_rebase() private
Consolatis [Wed, 7 Sep 2022 23:07:55 +0000 (01:07 +0200)]
cursor: Make cursor_rebase() private

Also allow to re-use node, surface, sx and sy.

3 years agocursor: Allow cursor button events to trigger cursor_rebase()
Consolatis [Wed, 7 Sep 2022 22:57:59 +0000 (00:57 +0200)]
cursor: Allow cursor button events to trigger cursor_rebase()

3 years agosrc/xdg.c: Only call view_moved() when required
Consolatis [Wed, 7 Sep 2022 22:55:57 +0000 (00:55 +0200)]
src/xdg.c: Only call view_moved() when required

3 years agodesktop: Cycle first to topmost view if not already focused
John Lindgren [Fri, 2 Sep 2022 20:41:27 +0000 (16:41 -0400)]
desktop: Cycle first to topmost view if not already focused

The topmost view may not always be the focused view; for example,
when Audacious's main window is focused but the floating Search
Tool window remains on top of it.  In that case the floating window
(not the main window) should be the first view selected in the
window switcher.

3 years agocursor: Update SSD hover state in cursor_rebase()
John Lindgren [Tue, 6 Sep 2022 16:05:47 +0000 (12:05 -0400)]
cursor: Update SSD hover state in cursor_rebase()

Fixes an issue where the maximize button would remain highlighted
after maximized a window.

3 years agocursor: Update focus at various additional points
John Lindgren [Sat, 3 Sep 2022 21:46:53 +0000 (17:46 -0400)]
cursor: Update focus at various additional points

- When XDG and XWayland views are positioned (view_moved()).
- When unmanaged XWayland surfaces are mapped, unmapped, or moved.

Do not update cursor focus during an out-of-surface drag.

Along with the existing call in desktop_move_to_front(), this
should hopefully cover the majority of cases where the cursor focus
could get out-of-date, with the possible exception of layer-shell
surfaces.

3 years agosrc/xwayland.c: Keep view->surface in sync
Consolatis [Sat, 3 Sep 2022 23:32:12 +0000 (01:32 +0200)]
src/xwayland.c: Keep view->surface in sync

3 years agosrc/xwayland.c: Update xsurface on client map request
Consolatis [Sat, 3 Sep 2022 22:22:43 +0000 (00:22 +0200)]
src/xwayland.c: Update xsurface on client map request

3 years agoxwayland: Don't center views with explicitly specified position
John Lindgren [Mon, 5 Sep 2022 01:45:03 +0000 (21:45 -0400)]
xwayland: Don't center views with explicitly specified position

3 years agoview: Call view_moved() immediately after map
John Lindgren [Mon, 5 Sep 2022 02:47:54 +0000 (22:47 -0400)]
view: Call view_moved() immediately after map

At least for XWayland surfaces, handle_commit() is not always
called after map(), and as a result, the scene-graph node is never
positioned.

Not sure 100% if the same can occur with XDG surfaces, but the
extra view_moved() call should be harmless, so add it there too
for consistency.

3 years agoxwayland: Factor out focus_next_surface() from unmanaged_handle_unmap()
John Lindgren [Sat, 3 Sep 2022 17:10:33 +0000 (13:10 -0400)]
xwayland: Factor out focus_next_surface() from unmanaged_handle_unmap()

- Eliminate multiple "return" paths in unmanaged_handle_unmap(), which
  were a bug waiting to happen.
- Use wl_list_for_each_reverse() rather than wl_list_for_each() to find
  the topmost (most-recently-created) unmanaged surface.
- Only call desktop_focus_topmost_mapped_view() if the unmapped surface
  was actually focused.

3 years agoCI: Split jobs
Consolatis [Fri, 2 Sep 2022 03:55:39 +0000 (05:55 +0200)]
CI: Split jobs

3 years agoCI: Additionally build without xwayland
Consolatis [Fri, 2 Sep 2022 03:30:12 +0000 (05:30 +0200)]
CI: Additionally build without xwayland

3 years agocursor: Fix out-of-surface movement for unmanaged surfaces
John Lindgren [Thu, 1 Sep 2022 21:50:28 +0000 (17:50 -0400)]
cursor: Fix out-of-surface movement for unmanaged surfaces

3 years agoxwayland: Keep unmanaged surfaces stacked on top
John Lindgren [Thu, 1 Sep 2022 18:33:42 +0000 (14:33 -0400)]
xwayland: Keep unmanaged surfaces stacked on top

3 years agosrc/xwayland-unmanaged.c: Give keyboard focus back to topmost mapped view
Consolatis [Tue, 30 Aug 2022 18:10:21 +0000 (20:10 +0200)]
src/xwayland-unmanaged.c: Give keyboard focus back to topmost mapped view

Previously, when unmapping and not finding another unmanaged surface
to give keyboard focus to we were not doing anything. With this patch
we will give focus to the topmost mapped view which is the same
behavior that also happens when an usual X11 surface unmaps.

This fixes dmenu when being exited with ESC.

Reported-by: @Flrian
3 years agosrc/config/rcxml.c: Add support for <devault /> mousebinds
Consolatis [Mon, 29 Aug 2022 21:43:13 +0000 (23:43 +0200)]
src/config/rcxml.c: Add support for <devault /> mousebinds

This loads default mousebinds and provides a way to keep config files
simpler whilst allowing user specific binds.

Note that if no rc.xml is found, or if no <mouse><mousebind> entries
exist, the same default mousebinds will be loaded even if the <devault />
element is not provided.

Example usage (with a slight spelling error):

  <mouse>
    <default />
    <context name="Root">
      <mousebind button="Right" action="Press">
        <action name="ShowMenu" menu="desktop-menu" />
      </mousebind>
    </context>
  </mouse>

Co-Authored-By: @johanmalm
Fixes #416

3 years agosrc/config/rcxml.c: Replace earlier mousebinds by later ones
Consolatis [Mon, 29 Aug 2022 21:42:40 +0000 (23:42 +0200)]
src/config/rcxml.c: Replace earlier mousebinds by later ones

3 years agosrc/config/mousebind.c: Fix mousebind ordering
Consolatis [Mon, 29 Aug 2022 21:06:53 +0000 (23:06 +0200)]
src/config/mousebind.c: Fix mousebind ordering

3 years agosrc/config/rcxml.c: Merge default mousebinds
Consolatis [Mon, 29 Aug 2022 20:47:34 +0000 (22:47 +0200)]
src/config/rcxml.c: Merge default mousebinds

3 years agosrc/view.c: Fix minimizing the last window
Consolatis [Tue, 30 Aug 2022 00:10:56 +0000 (02:10 +0200)]
src/view.c: Fix minimizing the last window

Before this patch, minimizing the last un-minimized window would
not cause it to be set to inactive. This in turn would confuse panels
which depend on the 'active' flag to decide when to either activate or
minimize the clicked on window.

Reported-by: @Flrian
Predicted-by: @johanmalm
3 years agoMerge pull request #307 from Consolatis/feature/tab_preview
Johan Malm [Sun, 28 Aug 2022 21:20:53 +0000 (22:20 +0100)]
Merge pull request #307 from Consolatis/feature/tab_preview

Feature/tab preview: restore functionality after the move to scene-graph

3 years agoMove OSD handler for view destruction to osd.c
Consolatis [Mon, 22 Aug 2022 00:54:40 +0000 (02:54 +0200)]
Move OSD handler for view destruction to osd.c

3 years agosrc/osd.c: Integrate preview outline into OSD state
Consolatis [Sun, 21 Aug 2022 22:42:01 +0000 (00:42 +0200)]
src/osd.c: Integrate preview outline into OSD state

3 years agoalt-tab preview: restore functionality after move to scene-graph
Consolatis [Tue, 26 Apr 2022 21:56:27 +0000 (23:56 +0200)]
alt-tab preview: restore functionality after move to scene-graph

3 years agoPrepare OSD for reimplementation of the preview feature
Consolatis [Tue, 26 Apr 2022 20:06:22 +0000 (22:06 +0200)]
Prepare OSD for reimplementation of the preview feature

3 years agoChase wlroots: Culling
Consolatis [Sat, 27 Aug 2022 14:21:22 +0000 (16:21 +0200)]
Chase wlroots: Culling

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots fa7d2cb8d60ed48c44c707106c03682056ddfaca
wlr_scene: Only consider visible parts of the node when culling background

Fixes #501

3 years agoosd: position preview border within SSD max extents
Johan Malm [Sat, 27 Aug 2022 12:26:30 +0000 (13:26 +0100)]
osd: position preview border within SSD max extents

This makes the border visible when alt-tabbing maximized windows and
prevents it from rendering on other outputs or on top of exclusive
layer-surfaces such as panels.

Closes issue #496

3 years agoview/ssd: Refactor and fix visual indication for active windows
John Lindgren [Fri, 26 Aug 2022 06:02:19 +0000 (02:02 -0400)]
view/ssd: Refactor and fix visual indication for active windows

Partially fixes #494.

Co-Authored-by: Consolatis
3 years agosrc/{common/font,theme}.c: Switch to cairo helpers
Consolatis [Fri, 26 Aug 2022 02:50:54 +0000 (04:50 +0200)]
src/{common/font,theme}.c: Switch to cairo helpers

3 years agoDisconnect view from destroying output
Consolatis [Wed, 24 Aug 2022 19:12:24 +0000 (21:12 +0200)]
Disconnect view from destroying output

Fixes #497

Reported-by @Flrian

3 years agoAdd config option to disable preview outlines
Flrian [Wed, 24 Aug 2022 18:27:08 +0000 (20:27 +0200)]
Add config option to disable preview outlines

3 years agokeyboard: Hide Alt-Tab switcher when canceling via Escape
John Lindgren [Sun, 21 Aug 2022 19:07:16 +0000 (15:07 -0400)]
keyboard: Hide Alt-Tab switcher when canceling via Escape

3 years agoosd: Do not show window switcher on disabled outputs
John Lindgren [Sun, 21 Aug 2022 19:01:32 +0000 (15:01 -0400)]
osd: Do not show window switcher on disabled outputs

3 years agosrc/osd.c: Add preview outlines
Consolatis [Mon, 4 Jul 2022 18:15:03 +0000 (20:15 +0200)]
src/osd.c: Add preview outlines

3 years agocommon/graphic-helpers: Add cairo helpers
Consolatis [Sat, 20 Aug 2022 18:11:58 +0000 (20:11 +0200)]
common/graphic-helpers: Add cairo helpers

3 years agocommon/graphic-helpers: Add multi_rect
Consolatis [Fri, 19 Aug 2022 22:01:06 +0000 (00:01 +0200)]
common/graphic-helpers: Add multi_rect

3 years agolabwc-theme(5): add menu.xbm
Johan Malm [Fri, 19 Aug 2022 21:50:12 +0000 (22:50 +0100)]
labwc-theme(5): add menu.xbm

3 years agoview: view_move() s/double/int/ for x and y
Johan Malm [Wed, 17 Aug 2022 20:41:49 +0000 (21:41 +0100)]
view: view_move() s/double/int/ for x and y

3 years agofunc output_destroy_notify add free
yizixiao [Wed, 17 Aug 2022 05:36:33 +0000 (13:36 +0800)]
func output_destroy_notify add free

3 years agosrc/cursor.c: refactor nested if-statements
Johan Malm [Tue, 16 Aug 2022 20:57:37 +0000 (21:57 +0100)]
src/cursor.c: refactor nested if-statements

3 years agocursor: do not clamp motion coordinates for xdg-shell surfaces
Johan Malm [Tue, 16 Aug 2022 20:56:39 +0000 (21:56 +0100)]
cursor: do not clamp motion coordinates for xdg-shell surfaces

...when pointer moves off the xdg-shell surface which is possible when
for example grabbing a scroll-bar or selecting text.

Clamping results in undetected pointer motion when applied in the
direction of movement (for example clamping at view->y masks vertical
movement when the y-coordinate is greater than view->y), which in turn
can appear as sporadic to the end-user.

3 years agosrc/cursor.c: Keep sending motion events for out-of-layer-surface
Consolatis [Sun, 14 Aug 2022 12:40:56 +0000 (14:40 +0200)]
src/cursor.c: Keep sending motion events for out-of-layer-surface

Previously, motion events for a cursor which had been pressed on a surface
and then moved out of the surface were only sent for XDG and X11 surfaces.

This patch includes layer surfaces as well.

Fixes #483

3 years agocursor: Do not clamp motion coordinates for XWayland surfaces.
John Lindgren [Sat, 13 Aug 2022 15:36:07 +0000 (11:36 -0400)]
cursor: Do not clamp motion coordinates for XWayland surfaces.

X11 apps expect to be able to receive motion events outside
the window area (this is necessary for client-side move/resize
handles to work properly).  So do not clamp the motion
coordinates for XWayland surfaces.

Before this change, attempting to enlarge an XWayland window
using a client-side resize handle resulted in the window size
lagging behind the mouse cursor quite severely, since each
motion event was in effect allowed to expand the window by
only a few pixels.  The closer the initial button-press was
to the edge of the window, the worse the lag would be.

3 years agokeybind: remove default alt-escape for Exit
Johan Malm [Fri, 12 Aug 2022 20:36:26 +0000 (21:36 +0100)]
keybind: remove default alt-escape for Exit

...because too many have exited the compositor by mistake trying to get
out of alt-tab cycling or similar.

3 years agosrc/ssd/ssd_titlebar.c: Completely hide title when running out of space
Consolatis [Fri, 12 Aug 2022 12:12:31 +0000 (14:12 +0200)]
src/ssd/ssd_titlebar.c: Completely hide title when running out of space

Before this commit the window title could overflow in certain conditions,
usually when rapidly resizing. This commit fixes it by completely hiding
the corresponding scene node when there is no space available.

Reported-by: <peperino> via IRC
3 years agoscaled_font_buffer.c: simplify calls to zfree()
Johan Malm [Tue, 2 Aug 2022 21:01:51 +0000 (22:01 +0100)]
scaled_font_buffer.c: simplify calls to zfree()

There is no need to check foo != NULL before zfree(foo)

3 years agomenu: render submenu arrows
Johan Malm [Tue, 2 Aug 2022 21:00:24 +0000 (22:00 +0100)]
menu: render submenu arrows

3 years agofont: remove unused font_buffer_update()
Johan Malm [Tue, 2 Aug 2022 20:43:44 +0000 (21:43 +0100)]
font: remove unused font_buffer_update()

3 years agomenu: do not require label attribute for highest level menu definition
Johan Malm [Thu, 11 Aug 2022 17:43:51 +0000 (18:43 +0100)]
menu: do not require label attribute for highest level menu definition

Allow highest level menu definitions - typically used for root-menu and
client-menu - to be defined like this:

    <openbox_menu>
      <menu id="">
      </menu>
    </openbox>

Previously this required a label attribute (which was not used for
anything and could be an empty string) as show below:

    <openbox_menu>
      <menu id="" label="">
      </menu>
    </openbox>

Closes issue #472

3 years agosrc/xwayland-unmanaged.c: Prevent racing configure event to reposition
Consolatis [Wed, 10 Aug 2022 04:14:55 +0000 (06:14 +0200)]
src/xwayland-unmanaged.c: Prevent racing configure event to reposition

Fixes #469

Reported-by: @Flrian
Suggested-by: @jlindgren90
3 years agoREADME.md: fix broken link for 'environment' man page
01micko [Mon, 1 Aug 2022 10:15:06 +0000 (20:15 +1000)]
README.md: fix broken link for 'environment' man page

- re: https://github.com/labwc/labwc.github.io/pull/1

3 years agoCI: auto-update freebsd-vm within major version
Jan Beich [Fri, 29 Jul 2022 20:09:06 +0000 (20:09 +0000)]
CI: auto-update freebsd-vm within major version

Reduce the churn by transparently picking up bustage fixes.

3 years agosrc/config/session.c: Handle allocation failures
Consolatis [Thu, 28 Jul 2022 09:03:50 +0000 (11:03 +0200)]
src/config/session.c: Handle allocation failures

Reported-by: @heroin-moose
3 years agosrc/config/session.c: Update dbus / systemd activation environment
Consolatis [Wed, 27 Jul 2022 23:06:56 +0000 (01:06 +0200)]
src/config/session.c: Update dbus / systemd activation environment

This allows xdg-desktop-portal-wlr to work out of the box for screen-recording.
If systemd or dbus is not available the environment update will fail gracefully.

This patch will set XDG_CURRENT_DESKTOP=wlroots but a user may change this by
either having the environment variable set before starting labwc or by having
a different value set in ~/.config/labwc/environment.

Based on PR #461 by @Joshua-Ashton

3 years agosrc/view.c: Fix output handling with no outputs available
Consolatis [Sun, 24 Jul 2022 20:43:41 +0000 (22:43 +0200)]
src/view.c: Fix output handling with no outputs available

Reported-by: @Flrian
3 years agoxwayland: Process unmanaged client configure requests more quickly
John Lindgren [Sat, 23 Jul 2022 15:20:34 +0000 (11:20 -0400)]
xwayland: Process unmanaged client configure requests more quickly

This is a similar fix to 065c37d3f5ee but for unmanaged windows.  The issue
could be seen for example when moving the undocked Search Tool window in
Audacious.  For unmanaged windows, we don't track any pending move/resizes,
so just process all client configure requests immediately.

3 years agoMerge pull request #457 from Consolatis/fix/xwayland_seat
Johan Malm [Thu, 21 Jul 2022 17:13:08 +0000 (18:13 +0100)]
Merge pull request #457 from Consolatis/fix/xwayland_seat

xwayland: (Re)set seat when xwayland is ready

3 years agoCI: Use MacOS-12 for FreeBSD runner
Consolatis [Thu, 21 Jul 2022 02:39:41 +0000 (04:39 +0200)]
CI: Use MacOS-12 for FreeBSD runner

3 years agoxwayland: (Re)set seat when xwayland is ready
Consolatis [Thu, 21 Jul 2022 00:47:20 +0000 (02:47 +0200)]
xwayland: (Re)set seat when xwayland is ready

For some reason wlroots will reset the seat assigned to xwayland
to NULL whenever Xwayland terminates. This patch restores the seat
whenever Xwayland is ready again.

Fixes #166
Fixes #444

Thanks @droc12345 for figuring out the actual issue.

3 years agoCI: Update FreeBSD runner
Consolatis [Thu, 21 Jul 2022 01:42:38 +0000 (03:42 +0200)]
CI: Update FreeBSD runner

3 years agoxwayland: Process move-only client configure requests more quickly
John Lindgren [Mon, 18 Jul 2022 03:42:04 +0000 (23:42 -0400)]
xwayland: Process move-only client configure requests more quickly

For a move-only client configure request, treat it similarly to
view_move() by updating the scene-graph immediately, rather than waiting
for handle_commit().  Move-and-resize requests are handled the same as
before.

This (mostly?) fixes the glitchiness that was noticeable when dragging
an undecorated XWayland window (e.g. Audacious in Winamp mode).

Also:

- Reduce some code duplication in handle_request_configure() by
  simply calling configure(), as suggested by @johanmalm in #428.
- Factor out common logic after a move and/or resize into view_moved().

3 years agoresistance: Do not consider edges of disabled outputs
John Lindgren [Mon, 18 Jul 2022 03:39:36 +0000 (23:39 -0400)]
resistance: Do not consider edges of disabled outputs

3 years agocursor: Move resistance_resize_apply() before view_adjust_size()
John Lindgren [Mon, 18 Jul 2022 03:38:11 +0000 (23:38 -0400)]
cursor: Move resistance_resize_apply() before view_adjust_size()

This ensures that screen edge resistance does not result in sizes
that violate WM_SIZE_HINTS constraints.

Also correct a coding style issue nearby.

3 years agoMerge pull request #454 from Joshua-Ashton/bump-fd-limit
Johan Malm [Sun, 17 Jul 2022 13:24:05 +0000 (14:24 +0100)]
Merge pull request #454 from Joshua-Ashton/bump-fd-limit

main: Increase FD limit

3 years agomain: Increase FD limit
Joshua Ashton [Sun, 17 Jul 2022 00:49:26 +0000 (00:49 +0000)]
main: Increase FD limit

This defaults to 1024, which is tiny, but is a requirement
for processes using the deprecated `select` function.

We must reset this back whenever we fork to start a new process,
as this is inherited, and breaks applications using `select` otherwise.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
3 years agocommon: Add helpers for raising/lowering FD limit
Joshua Ashton [Sun, 17 Jul 2022 00:47:20 +0000 (00:47 +0000)]
common: Add helpers for raising/lowering FD limit

Signed-off-by: Joshua Ashton <joshua@froggi.es>
3 years agobuf.c: fix bug in environment variable expansion
Johan Malm [Fri, 15 Jul 2022 19:29:49 +0000 (20:29 +0100)]
buf.c: fix bug in environment variable expansion

Allow underscore in environment variable names.

Closes issue #439

Helped-by: @Consolatis
...who both found the bug and told us how to fix it :)

3 years agoNEWS.md: add notes on 0.5.3
Johan Malm [Fri, 15 Jul 2022 19:05:43 +0000 (20:05 +0100)]
NEWS.md: add notes on 0.5.3

3 years agoNEWS.md: add notes on 0.6.0
Johan Malm [Wed, 13 Jul 2022 23:24:25 +0000 (00:24 +0100)]
NEWS.md: add notes on 0.6.0

3 years agocursor: Fix crash when creating a cursor constraint
Joshua Ashton [Thu, 14 Jul 2022 02:19:36 +0000 (02:19 +0000)]
cursor: Fix crash when creating a cursor constraint

Fix crash when creating a cursor constraint and there is no currently
focused view.

Fixes a crash starting Warhammer 40,000: Dawn of War II (15620)

3 years agoconfig/rcxml.c: Fix parsing of adaptiveSync setting
Consolatis [Wed, 13 Jul 2022 23:01:10 +0000 (01:01 +0200)]
config/rcxml.c: Fix parsing of adaptiveSync setting

3 years agoCI: upgrade FreeBSD to 13.1
Jan Beich [Wed, 13 Jul 2022 21:30:36 +0000 (21:30 +0000)]
CI: upgrade FreeBSD to 13.1

FreeBSD doesn't support /latest and /quarterly package repos on EOL
versions. 13.0 reaches EOL on 2022-08-31, so avoid CI breakage.

3 years agoCI: Add missing deps for Void Linux runner
Krsna Mahapatra [Mon, 11 Jul 2022 20:49:25 +0000 (16:49 -0400)]
CI: Add missing deps for Void Linux runner

3 years agosrc/view.c: Prevent crash by killing a moving application
Consolatis [Sun, 10 Jul 2022 21:24:32 +0000 (23:24 +0200)]
src/view.c: Prevent crash by killing a moving application

When a view is destroyed labwc calls interactive_end(view) which
may reposition the view which is partly destroyed and doesn't own
any surface anymore. To prevent this scenario from happening don't
call interactive_end() at all and just reset server->grabbed_view
and server->input_mode directly.

Before this patch, the bug could be reproduced by:
- xcalc &
- sleep 5; killall xcalc
- move the xcalc window completely to one of the edges

The change in src/xwayland.c is not required for this bug
to be fixed but may prevent something similar in the future.

3 years agoREADME.md: refresh and refactor
Johan Malm [Sun, 10 Jul 2022 15:43:05 +0000 (16:43 +0100)]
README.md: refresh and refactor

- Use &nsbp; in links with spaces
- Change headings from verbs to nouns
- Combine build and install headings
- In 'What is this', use the text on the labwc website
- Remove video links; one wasn't working and the other were very old
- Use more recent screenshot
- Simplify the 'labwc supports the following' bullet points
- Split dependencies into build and run-time
- Remove dependecy version numbers and let meson.build be the source of
  truth
- Simplify config file table by taking out middle column
- Split the configuration section into configuration and theming
- s/roadmap/scope
- Change man page links from docs/ to labwc.github.io/

3 years agosrc/output.c: Always react to new output configuration
Consolatis [Fri, 8 Jul 2022 22:42:04 +0000 (00:42 +0200)]
src/output.c: Always react to new output configuration

Without this fix we will never react to output configuration changes
via wlr-randr and friends.

If output_config_apply() commits the new config, handle_output_layout_change()
is called but doesn't do anything because the config is still pending.

This patch moves the code into its own function do_output_layout_change()
which additionally gets called after all output configs are committed.

The original handler is turned into a wrapper around do_output_layout_change().

Reported-by @heroin-moose

3 years agoxwayland.c: fix position bug
Johan Malm [Mon, 4 Jul 2022 17:25:52 +0000 (18:25 +0100)]
xwayland.c: fix position bug

Set node position in the configure/set_geometry handlers when moving a
window in response to a client request.

Steps to reproduce weird positioning fixed by this patch:

1. Start leafpad
2. Open Help->About
3. Move the dialog
4. Close the dialog
5. Open it again
6. Drag it and observe a jump in position

There is also an xwayland PyQt5 script in PR #428 which demonstrates
jumpy position.

3 years agosrc/action.c: Convert action->arg to a list of action_arg
Consolatis [Fri, 10 Jun 2022 17:42:34 +0000 (19:42 +0200)]
src/action.c: Convert action->arg to a list of action_arg

In preperation for Actions that require multiple arguments

3 years agosrc/view.c: Fall back to default geometry when changing state
Consolatis [Sat, 2 Jul 2022 18:23:14 +0000 (20:23 +0200)]
src/view.c: Fall back to default geometry when changing state

This makes sure that applications starting in maximized of fullscreen
mode always have their natural_geometry set to sensible values.

Partly fixes #403

3 years ago(Partly) fix handling of client-initiated configure requests
John Lindgren [Sat, 2 Jul 2022 17:18:31 +0000 (13:18 -0400)]
(Partly) fix handling of client-initiated configure requests

- Add missing call to wlr_scene_node_set_position() in
  unmanaged_handle_commit() -- this fixes moving unmanaged XWayland
  windows.

- Update view->pending_move_resize when we receive a configure request
  for a managed XWayland surface -- this fixes moving managed but
  undecorated XWayland windows.

- Also update view->pending_move_resize when we move a surface while a
  configure request is already pending -- this fixes a discrepancy
  between displayed and actual position for XWayland windows that try to
  set their own initial position, but then get overridden by labwc's
  positioning.

Moving undecorated XWayland windows is still really glitchy -- it appears
that an XWayland window gets sent incorrect mouse motion coordinates when
there is a pending configure request moving the window itself.

3 years agoRestore original geometry when moving a tiled window
Consolatis [Fri, 1 Jul 2022 18:42:41 +0000 (20:42 +0200)]
Restore original geometry when moving a tiled window

Fixes #391

3 years agoRename unmaximized_geometry to natural_geometry
Consolatis [Fri, 1 Jul 2022 17:34:56 +0000 (19:34 +0200)]
Rename unmaximized_geometry to natural_geometry

3 years agosrc/view.c: Unmaximize on SnapToEdge
Consolatis [Fri, 1 Jul 2022 18:44:40 +0000 (20:44 +0200)]
src/view.c: Unmaximize on SnapToEdge

3 years agosrc/view.c: Prevent SnapToEdge while in fullscreen
Consolatis [Fri, 1 Jul 2022 18:42:09 +0000 (20:42 +0200)]
src/view.c: Prevent SnapToEdge while in fullscreen

3 years agosrc/view.c: Re-arrange tiled windows on un-fullscreen and un-maximize
Consolatis [Fri, 1 Jul 2022 18:40:18 +0000 (20:40 +0200)]
src/view.c: Re-arrange tiled windows on un-fullscreen and un-maximize