Commit graph

619 commits

Author SHA1 Message Date
Consolatis
e5a511668e src/config/keybind.c: fix keybind insertion order
This restores the intended behavior of keybinds set by `<default />`
to be overwritten by manually configured keybinds which come later in
the config.

In `src/keyboard.c`, `handle_keybinding()` is going backwards through
the list of keybindings and breaks after the first match.

`wl_list_insert(&list_node, item)` will insert the new item *after* the
list_node so if its called multiple times with the same list_node as
fist argument the result will be a reversed list. Using `list_node.prev`
instead will result in a non-reversed list.

Backport of 39cdba36a8
2022-08-10 05:51:55 +02:00
Johan Malm
67ed986969 action.c: use kill() instead of spawning killall
Also update documentation to say `killall -s SIGHUP labwc` to make
it work on Void Linux.

Fix #393

Backport of 5f30773a6e
2022-08-10 05:51:55 +02:00
Johan Malm
f20fc65f41 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 :)

Backport of fd7ec0ab95
2022-08-10 05:51:55 +02:00
Consolatis
519d97a897 config/rcxml.c: Fix parsing of adaptiveSync setting
Backport of 79b1630724
2022-08-10 05:51:55 +02:00
Flrian
916f9a79ea output-power-management: add damage_all_outputs() 2022-06-14 05:25:04 +02:00
Johan Malm
834ee3dfd4 output: fix incorrect call to private wlroots function
Use wlr_output_test() instead of output_ensure_buffer() which is not a
public function and only compiled when linking statically to wlroots.

Also wlr_output_rollback() on failed test.

Fixes issue #273

Backport of 5fd5024ca6
2022-06-14 05:25:04 +02:00
bi4k8
0fb33066e9 support wlr-output-power-management
Backport of c23397f362
2022-06-14 05:25:04 +02:00
Johan Malm
12718e5e63 xwayland: call foreign-toplevel-destroy on unmap
Some xwayland clients leave unmapped child views around, typically when a
dialog window is closed. Although handle_destroy() is not called for
these, we have to call foreign-toplevel-destroy to avoid panels and the
like incorrecly showing them.

Backport of 62ae87bbd9
2022-06-03 19:35:07 +01:00
Johan Malm
03c6f23d6d xwayland: handle set_override_redirect events
This is needed to allow X11 applications to create surfaces as
non-override_redirect and then change them to override_redirect later

Without this gitk-menus and rofi are treated as xwayland-views with
associated server-side-decoration and forced positioning.

Backport of 81f216b6a2
2022-06-03 19:35:07 +01:00
Jelle De Loecker
9b593e4715 xwayland-unmanaged: focus parent surface on unmap
Re-focus on parent surface if it is available

Fixes #352 relating to JetBrains and Intellij focus issues

Backport of 61675b521c
2022-06-03 19:35:07 +01:00
Consolatis
9cd502f0bf cursor.c: Do not segfault on missing drag icon
Observed by moving tabs in chromium wayland native
(started with --ozone-platform-hint=wayland).

Backport of 47912aebb6
2022-05-29 19:52:14 +01:00
Consolatis
0284956ce8 src/cursor.c: Ignore out-of-surface movement for surfaces without views
Backport of 499df78531
2022-05-29 19:52:14 +01:00
Consolatis
0738965f2d src/cursor.c: Ensure we send a release event for out-of-surface scrolling
Backport of b24b9d2d23
2022-05-29 19:52:14 +01:00
Johan Malm
74da710c98 cursor: offset xdg invisible border when dragging outside view
Note: view->padding was deleted in commit b279550 as the wlroots
scene-graph xdg-surface commit handler offsets the CSD invisible border.
If view->padding still existed, we could have used that, but considering
that this is probably the only place where this offset will now be
needed (because we're generating surface local coordinates), it's simpler
to just do it locally.

Related to issue #340

Written-by: @Consolatis
Backport of 81810db3b6
2022-05-29 19:52:14 +01:00
Consolatis
cc0e2769d9 src/cursor.c: Fix branch condition for out-of-view selecting/dragging
Instead of using the stored view for comparison use the actual surface.

Before this patch, there were situations where the branch intended for
out-of-window text selection / scrollbar dragging was used even though
the cursor never left the surface.

Partly fixes #340
Fixes #347

Backport of 6dd290afc9
2022-05-29 19:52:14 +01:00
Johan Malm
ae15be8555 resistance.c: initialize 'flags' to zero
...in both resistance_resize_apply() and resistance_move_apply()

Failure to initialize these variables sometimes causes windows to stick to
edges during move/resize.

Issues #331 and #309 may be related to this
2022-05-18 20:58:54 +01:00
Consolatis
253c53cd28 cursor.c: make sure resize_edges is always assigned a value
Fixes #318
2022-05-17 17:32:35 +01:00
John Lindgren
a50d27c770 cursor: Fix "jumping opposite edges" issue when resizing.
Commit ec68806354 ("xwayland: Honor size increments from
WM_SIZE_HINTS") adjusted only the window width/height according
to the size hints.  If resizing from the top or left edge of the
window, we also need to adjust the window position to keep the
bottom or right edge from jumping around.
2022-04-04 17:30:20 +01:00
John Lindgren
ec68806354 xwayland: Honor size increments from WM_SIZE_HINTS 2022-03-20 21:22:14 +00:00
Consolatis
03826a1348 xwayland.c: Do not raise window if deactivating
Fixes #270
2022-03-12 14:23:22 +00:00
Consolatis
a52feadaa7 Restore Drag mouse bindings and proper double click
Fixes #258 and #259

Reported-by: @ahmadraniri1994
Reported-by: @01micko
Suggested-by: bi4k8 <bi4k8@github>
2022-02-27 22:18:41 +00:00
Consolatis
1d9c9d1afc Implement cursor input for overlay popups 2022-02-26 20:27:43 +00:00
Johan Malm
ce38d2dbd6 cursor: add cursor_update_focus()
...and call it from desktop_move_to_front() in order force an enter event
on the surface below the cursor when cycling views.

Fixes #162 and #225
Inspired by PR #164 - just restructured it a bit.

Suggested-by: @bi4k8
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
2022-02-26 20:23:55 +00:00
Consolatis
841b6550a9 xwayland.c: Fix positioning with multiple queued configure events
Prevents a single action like ToggleDecorations + ToggleMaximize to
position the view somewhere with negative coordinates when unmaximizing.

It may still position the view on negative coordinates but later commit
events will fix the position. This issue only exists on xwayland because
there are no configure serials which we could use to ignore all
repositioning until we are at the latest desired state.
2022-02-26 20:23:30 +00:00
Consolatis
00b2925461 cursor.c: Keep sending adjusted motion events while button is pressed
This allows to keep dragging a scrollbar or selecting text even when
moving outside of the window. Fixes #241
2022-02-26 20:22:49 +00:00
John Lindgren
7488ec53dd Implement cursor input for unmanaged XWayland surfaces
This is necessary for menus in X11 apps to work properly.
Otherwise, any region of the menu that extended out beyond the main
application window was not receiving any mouse input.

Adapted from sway's code.
2022-02-20 13:30:29 +00:00
Johan Malm
588f233151 output: render overlay lay popups
This enables sfwbar popups and fixes issue #239

https://github.com/LBCrion/sfwbar
2022-02-13 09:45:42 +00:00
ARDiDo
7c437eac2f OSD: Use separate OSD texture for each output 2022-02-09 21:57:32 +00:00
ARDiDo
049b84409e OSD: Scale OSD to the largest output scale 2022-02-09 21:57:32 +00:00
Consolatis
53df672dda Reload environment on SIGHUP. Partly fixes #227 2022-02-08 06:08:12 +00:00
Consolatis
fb09bbdd2f src/cursor.c: Reduce damage on button hover detection 2022-01-30 21:23:15 +00:00
Consolatis
413811f3a2 Use proper enum argument type for desktop_surface_and_view_at 2022-01-30 21:23:15 +00:00
Consolatis
7ecae4afce Move is_button() into src/ssd.c and make it public 2022-01-30 21:23:15 +00:00
ARDiDo
e2cca1f040 CSD: Fix no fullscreen at startup in some applications without ssd 2022-01-29 10:44:15 -05:00
Consolatis
3658c2bfb3 src/output.c: fix debug flag for full frame damage 2022-01-28 07:33:46 +00:00
Consolatis
b7b1e8064f Add WindowMenu button 2022-01-26 06:17:41 +00:00
Consolatis
759b26b5c1 Add window menu 2022-01-26 06:17:41 +00:00
Consolatis
4bc8726abd src/ssd.c: Clarify button dimension calculations 2022-01-25 20:18:51 +00:00
ARDiDo
7a3cd6549e xwayland: Allow xorg applications to start in fullscreen 2022-01-24 17:57:35 -05:00
Johan Malm
8dd3dc3e3b cursor: cursor_rebase() on mouse scroll
...to ensure that the surface under the mouse gets the focus even
if the mouse pointer has not moved.

Issue #162
2022-01-24 17:54:06 +00:00
Johan Malm
2652522a70 cursor: revert 6651d; remove cursor_update_focus()
...to ensure new windows receive keyboard focus even if the cursor is
over an existing window.

Fix issue #210
2022-01-24 17:51:54 +00:00
Liam Middlebrook
875b258602 output: Add option to preview the contents of the current cycle_view
Add the 'cycleViewPreview.core' option to rc.xml to enable previews of
the selected view when cycling between windows. Default this option to
be disabled to match current behavior.
2022-01-23 16:02:54 +00:00
Consolatis
c484ab252e config/rcxml: Prevent overwriting action argument 2022-01-23 10:44:51 -05:00
Consolatis
f0a3f365e5 Centralize freeing of action lists
Reduces some code duplication and makes it easier to extend struct action
2022-01-23 10:36:04 -05:00
ARDiDo
8e9643a855 xdg: Allow wayland applications to start in fullscreen 2022-01-20 20:56:47 -05:00
Consolatis
5f27356fc1 Short term solution to prevent segfaulting on TTY switch. See #206.
This will still prevent touchscreens or other absolute pointers to
function correctly after switching the TTY when using a multi
screen setup. But that is still better than segfaulting.
2022-01-18 06:06:12 +00:00
Johan Malm
92b64e9581 ssd: revert last commit
It was just not a good implementation; we need to consider xdg-shell views
as well as xwayland ones.

Issue #207
2022-01-17 21:00:52 +00:00
Johan Malm
35e24a67ec ssd: do not render resize cursors over exclusive layer-shell clients
...such as panels, even if the invisible region of a view's server-side
decoration extends over that layer-shell client.

Issue #207
2022-01-10 18:14:53 +00:00
Johan Malm
4964ecd80c desktop: correctly forward cursor motion-event to layer-popup surfaces
...in preference to views and other layer surfaces (except those in the
OVERLAY layer which always go first)

Fixes issue #207 where a BOTTOM layer popup lost mouse focus when a
terminal was behind it.
2022-01-10 18:08:27 +00:00
Consolatis
d9cef42721 CodeStyle 2022-01-09 06:37:39 +00:00