]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
4 years agoRefactor buffer implementation to take a cairo_t
Johan Malm [Sun, 13 Feb 2022 11:47:03 +0000 (11:47 +0000)]
Refactor buffer implementation to take a cairo_t

Remove buffer_drop() and just destroy it.

4 years agoxwayland: in map() use wlr_scene_subsurface_tree_create()
Johan Malm [Sat, 12 Feb 2022 22:13:36 +0000 (22:13 +0000)]
xwayland: in map() use wlr_scene_subsurface_tree_create()

4 years agoosd: destroy old osd_tree children
Johan Malm [Sat, 12 Feb 2022 22:04:27 +0000 (22:04 +0000)]
osd: destroy old osd_tree children

4 years agoAdd debug_dump_scene()
Johan Malm [Sat, 12 Feb 2022 19:43:32 +0000 (19:43 +0000)]
Add debug_dump_scene()

Dump view_tree and osd_tree on calling debug-action. Example bind:

<keybind key="A-F12">
  <action name="Debug"></action>
</keybind>

4 years agoUse wlroots scene-graph API
Johan Malm [Fri, 11 Feb 2022 23:12:45 +0000 (23:12 +0000)]
Use wlroots scene-graph API

Move xdg-shell and xwayland-shell surfaces to new API

Also render alt-tab on-screen-display by converting cairo-surface to
wlr_buffer

4 years agoAdd buffer.c to cover cairo-surface to wlr_buffer
Johan Malm [Fri, 11 Feb 2022 22:19:05 +0000 (22:19 +0000)]
Add buffer.c to cover cairo-surface to wlr_buffer

4 years agoREADME.md: add link to IRC channel
Johan Malm [Sun, 20 Feb 2022 15:02:53 +0000 (15:02 +0000)]
README.md: add link to IRC channel

4 years agoREADME.md: fix typo (issue #248)
Johan Malm [Sun, 20 Feb 2022 15:02:08 +0000 (15:02 +0000)]
README.md: fix typo (issue #248)

4 years agoNEWS.md: add notes on 0.5.0
Johan Malm [Fri, 18 Feb 2022 21:54:07 +0000 (21:54 +0000)]
NEWS.md: add notes on 0.5.0

4 years agobuild: bump version to 0.5.0
Johan Malm [Fri, 18 Feb 2022 21:24:38 +0000 (21:24 +0000)]
build: bump version to 0.5.0

4 years agoUpdate README.md
hype3 [Thu, 17 Feb 2022 17:29:55 +0000 (19:29 +0200)]
Update README.md

4 years agoUpdate README.md
hype3 [Thu, 17 Feb 2022 16:35:28 +0000 (18:35 +0200)]
Update README.md

4 years agooutput: render overlay lay popups
Johan Malm [Sun, 13 Feb 2022 09:45:42 +0000 (09:45 +0000)]
output: render overlay lay popups

This enables sfwbar popups and fixes issue #239

https://github.com/LBCrion/sfwbar

4 years agoOSD: Use separate OSD texture for each output
ARDiDo [Wed, 9 Feb 2022 21:38:07 +0000 (16:38 -0500)]
OSD: Use separate OSD texture for each output

4 years agoOSD: Scale OSD to the largest output scale
ARDiDo [Sun, 6 Feb 2022 00:23:30 +0000 (19:23 -0500)]
OSD: Scale OSD to the largest output scale

4 years agoReload environment on SIGHUP. Partly fixes #227
Consolatis [Tue, 8 Feb 2022 00:19:24 +0000 (01:19 +0100)]
Reload environment on SIGHUP. Partly fixes #227

4 years agowlroots.wrap: use 0.15.1
Johan Malm [Mon, 7 Feb 2022 16:53:37 +0000 (16:53 +0000)]
wlroots.wrap: use 0.15.1

4 years agobuild: Relax the version constraint for wlroots to accept patch releases
Michael Weiss [Fri, 4 Feb 2022 20:17:05 +0000 (21:17 +0100)]
build: Relax the version constraint for wlroots to accept patch releases

Patch releases only contain backwards compatible changes (mainly bug
fixes) so we want to allow them. This fixes the build with the recently
released wlroots 0.15.1 and uses the same version constraints as other
projects that depend on wlroots (e.g., Sway).

4 years agoAdd missing docs for mouse window snapping
Consolatis [Sat, 29 Jan 2022 20:49:00 +0000 (21:49 +0100)]
Add missing docs for mouse window snapping

4 years agosrc/cursor.c: Reduce damage on button hover detection
Consolatis [Sat, 29 Jan 2022 17:36:56 +0000 (18:36 +0100)]
src/cursor.c: Reduce damage on button hover detection

4 years agoUse proper enum argument type for desktop_surface_and_view_at
Consolatis [Sat, 29 Jan 2022 16:52:16 +0000 (17:52 +0100)]
Use proper enum argument type for desktop_surface_and_view_at

4 years agoMove is_button() into src/ssd.c and make it public
Consolatis [Sat, 29 Jan 2022 16:46:17 +0000 (17:46 +0100)]
Move is_button() into src/ssd.c and make it public

4 years agoCSD: Fix no fullscreen at startup in some applications without ssd
ARDiDo [Sat, 29 Jan 2022 15:44:15 +0000 (10:44 -0500)]
CSD: Fix no fullscreen at startup in some applications without ssd

4 years agosrc/output.c: fix debug flag for full frame damage
Consolatis [Thu, 27 Jan 2022 18:35:17 +0000 (19:35 +0100)]
src/output.c: fix debug flag for full frame damage

4 years agoAdd WindowMenu button
Consolatis [Wed, 26 Jan 2022 01:54:03 +0000 (02:54 +0100)]
Add WindowMenu button

4 years agoAdd window menu
Consolatis [Tue, 25 Jan 2022 23:07:10 +0000 (00:07 +0100)]
Add window menu

4 years agosrc/ssd.c: Clarify button dimension calculations
Consolatis [Tue, 25 Jan 2022 09:17:43 +0000 (10:17 +0100)]
src/ssd.c: Clarify button dimension calculations

4 years agoxwayland: Allow xorg applications to start in fullscreen
ARDiDo [Mon, 24 Jan 2022 22:57:35 +0000 (17:57 -0500)]
xwayland: Allow xorg applications to start in fullscreen

4 years agocursor: cursor_rebase() on mouse scroll
Johan Malm [Mon, 24 Jan 2022 17:54:06 +0000 (17:54 +0000)]
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

4 years agocursor: revert 6651d; remove cursor_update_focus()
Johan Malm [Mon, 24 Jan 2022 17:51:54 +0000 (17:51 +0000)]
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

4 years agooutput: Add option to preview the contents of the current cycle_view
Liam Middlebrook [Thu, 20 Jan 2022 19:38:23 +0000 (11:38 -0800)]
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.

4 years agoconfig/rcxml: Prevent overwriting action argument
Consolatis [Sun, 23 Jan 2022 13:46:56 +0000 (14:46 +0100)]
config/rcxml: Prevent overwriting action argument

4 years agoCentralize freeing of action lists
Consolatis [Sun, 23 Jan 2022 12:46:46 +0000 (13:46 +0100)]
Centralize freeing of action lists

Reduces some code duplication and makes it easier to extend struct action

4 years agoxdg: Allow wayland applications to start in fullscreen
ARDiDo [Fri, 21 Jan 2022 01:56:47 +0000 (20:56 -0500)]
xdg: Allow wayland applications to start in fullscreen

4 years agoShort term solution to prevent segfaulting on TTY switch. See #206.
Consolatis [Mon, 17 Jan 2022 22:02:59 +0000 (23:02 +0100)]
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.

4 years agossd: revert last commit
Johan Malm [Mon, 17 Jan 2022 21:00:52 +0000 (21:00 +0000)]
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

4 years agossd: do not render resize cursors over exclusive layer-shell clients
Johan Malm [Mon, 10 Jan 2022 18:14:53 +0000 (18:14 +0000)]
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

4 years agodesktop: correctly forward cursor motion-event to layer-popup surfaces
Johan Malm [Mon, 10 Jan 2022 18:08:27 +0000 (18:08 +0000)]
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.

4 years agoCodeStyle
Consolatis [Sun, 9 Jan 2022 04:48:27 +0000 (05:48 +0100)]
CodeStyle

4 years agoview: Handle maximized view on disabled output more simply
John Lindgren [Sat, 8 Jan 2022 16:46:46 +0000 (11:46 -0500)]
view: Handle maximized view on disabled output more simply

Partially reverts commit ab07b68d7e888211e9ef5a3731f5272912d4b878.

4 years agoAllow mouse movements to trigger SnapToEdge
Consolatis [Sat, 8 Jan 2022 10:25:18 +0000 (11:25 +0100)]
Allow mouse movements to trigger SnapToEdge

4 years agocursor: More reliably clear "pressed" status of mouse bindings
John Lindgren [Sat, 8 Jan 2022 07:47:30 +0000 (02:47 -0500)]
cursor: More reliably clear "pressed" status of mouse bindings

The "pressed" status of the mouse button is stored per-binding, and
the first binding activated causes us to break out of the loop that
cleared the "pressed" status -- as a result, some statused weren't
cleared when another binding was activated.

The bug could be seen when clicking the maximize button on a window
and then moving the mouse: the DRAG action would continue to move
the window (unmaximizing it) even though the mouse button was no
longer held.

4 years agocursor: Don't allow a DRAG action to start from a double-click
John Lindgren [Sat, 8 Jan 2022 07:01:14 +0000 (02:01 -0500)]
cursor: Don't allow a DRAG action to start from a double-click

By moving the cursor slightly after the second press (but before
the second release) it was possible to accidentally trigger both a
DOUBLECLICK and a DRAG action.  Doing this on the titlebar would
cause the window to maximize and then immediately unmaximize, which
feels very "glitchy".

As a simple fix, don't allow a press event that is triggering a
DOUBLECLICK to also trigger a DRAG (or CLICK) on the following
release event.

Note: Openbox avoids the issue by processing DOUBLECLICK on the
second release event.  If the cursor moves before that, the DRAG
wins out and the DOUBLECLICK isn't processed.

4 years agoUnmaximize on Move
Consolatis [Wed, 5 Jan 2022 07:30:07 +0000 (08:30 +0100)]
Unmaximize on Move

4 years agomousebindings: use available resize edges first in drag actions
ARDiDo [Fri, 7 Jan 2022 21:19:51 +0000 (16:19 -0500)]
mousebindings: use available resize edges first in drag actions

4 years agomousebindings: change default focus and raise to press from drag.
ARDiDo [Fri, 7 Jan 2022 21:13:36 +0000 (16:13 -0500)]
mousebindings: change default focus and raise to press from drag.

This raises the window without having to drag it.

4 years agolabwc-config: fix spelling mistake
ARDiDo [Fri, 7 Jan 2022 20:53:13 +0000 (15:53 -0500)]
labwc-config: fix spelling mistake

4 years agomouse: add support for drag mouse event
ARDiDo [Thu, 6 Jan 2022 23:30:17 +0000 (18:30 -0500)]
mouse: add support for drag mouse event

4 years agoview: adjust views safety following layout change
Johan Malm [Fri, 7 Jan 2022 22:01:44 +0000 (22:01 +0000)]
view: adjust views safety following layout change

Refactor view_adjust_for_layout_change() in order to:

- Use view_maximize() - otherwise the unmaximized geometry remains off
  the screen.
- Avoid relying on view_apply_maximized_geometry() to handle missing
  output

Issue #194

4 years agoview: fix bug in view_snap_to_edge()
Johan Malm [Fri, 7 Jan 2022 20:53:48 +0000 (20:53 +0000)]
view: fix bug in view_snap_to_edge()

Use view_move() and view_move_resize() correctly.

view_move_resize() should only be used when the view actually changes
width and/or height, otherwise the serials might cause a delay in moving
xdg-shell clients.

Issue #201

4 years agoseat: support WLR_{WL,X11}_OUTPUTS >= 2
Johan Malm [Thu, 6 Jan 2022 21:40:10 +0000 (21:40 +0000)]
seat: support WLR_{WL,X11}_OUTPUTS >= 2

When running nested in X11 or a wlroots compositor with the respective
environment variables WLR_X11_OUTPUTS or WLR_WL_OUTPUTS set to value >= 2,
cursors need to be mapped to the respective outputs.

Closes issue #196

Suggested-by: @Consolatis
Written-by: @johanmalm
4 years agoMore robust rc.xml parsing
Consolatis [Thu, 6 Jan 2022 02:24:32 +0000 (03:24 +0100)]
More robust rc.xml parsing

4 years agoPrevent views from starting in fullscreen
ARDiDo [Wed, 5 Jan 2022 22:02:58 +0000 (17:02 -0500)]
Prevent views from starting in fullscreen

4 years agoMove action() prototype from labwc.h to action.h
Johan Malm [Wed, 5 Jan 2022 21:27:47 +0000 (21:27 +0000)]
Move action() prototype from labwc.h to action.h

4 years agoaction.{c,h}: fix coding style
Johan Malm [Wed, 5 Jan 2022 21:23:01 +0000 (21:23 +0000)]
action.{c,h}: fix coding style

4 years agoRewrite action handling to allow multiple actions at once
Consolatis [Wed, 5 Jan 2022 08:11:24 +0000 (09:11 +0100)]
Rewrite action handling to allow multiple actions at once

4 years agowlroots.wrap: add .git to url to avoid redirection warning
Johan Malm [Tue, 4 Jan 2022 21:27:59 +0000 (21:27 +0000)]
wlroots.wrap: add .git to url to avoid redirection warning

4 years agodocs/autostart: remove wlr-randr {--off,--on}
Johan Malm [Mon, 3 Jan 2022 23:32:02 +0000 (23:32 +0000)]
docs/autostart: remove wlr-randr {--off,--on}

swayidle previously used wlr-randr to enable/disable outputs, but since
commit a837fefc, this re-arranges views so is not to be used in the
context of idle system power management.

4 years agoconfig/keybind.c: Don't overwrite the stack
Consolatis [Mon, 3 Jan 2022 04:38:48 +0000 (05:38 +0100)]
config/keybind.c: Don't overwrite the stack

4 years agodesktop: simplify desktop_focus_and_activate_view()
Johan Malm [Sun, 2 Jan 2022 15:53:05 +0000 (15:53 +0000)]
desktop: simplify desktop_focus_and_activate_view()

...following view->surface checks in 295d5172

4 years agocursor.c: fix coding style
Johan Malm [Sun, 2 Jan 2022 15:51:40 +0000 (15:51 +0000)]
cursor.c: fix coding style

Open brace '{' following function definitions go on the next line

4 years agokeyboard: cancel repeat when handling key-bind
Johan Malm [Sun, 2 Jan 2022 15:28:35 +0000 (15:28 +0000)]
keyboard: cancel repeat when handling key-bind

<keybind key="W-d">
  <action name="Execute">
    <command>dmenu_run</command>
  </action>
</keybind>

When using the keybind above (in rc.xml), on the first execution of W-d
all is okay, but the second time, a "d" pressed event is sent to dmenu
resulting in a continuous "ddddddd...") which has to be stopped pressing a
key.

This behaviour started in commit 7e57b7f because release events associated
with keybinds are no longer sent to clients (before that commit, the
release event for the ā€œdā€ would have been passed to dmenu, thus cancelling
the repeat).

Solves issue #176

Helped-by: @spectrum70
4 years agofullscreen: ignore decorations and maximize requests while fullscreen
ARDiDo [Sun, 2 Jan 2022 15:19:48 +0000 (10:19 -0500)]
fullscreen: ignore decorations and maximize requests while fullscreen

4 years agoREADME.md: update acceptance criteria URL
Johan Malm [Sat, 1 Jan 2022 20:35:36 +0000 (20:35 +0000)]
README.md: update acceptance criteria URL

4 years agoUpdate NEWS.md
Johan Malm [Sat, 1 Jan 2022 20:18:57 +0000 (20:18 +0000)]
Update NEWS.md

4 years agocursor: support pointer gestures (pinch/swipe)
bi4k8 [Fri, 31 Dec 2021 23:34:08 +0000 (23:34 +0000)]
cursor: support pointer gestures (pinch/swipe)

4 years agofactor keyboard/cursor cleanup into own functions
bi4k8 [Fri, 31 Dec 2021 23:30:25 +0000 (23:30 +0000)]
factor keyboard/cursor cleanup into own functions

4 years agodecorations: use view_apply_maximized_geometry instead of view_maximize
ARDiDo [Sat, 1 Jan 2022 16:50:35 +0000 (11:50 -0500)]
decorations: use view_apply_maximized_geometry instead of view_maximize

4 years agoAdjust views to account for output layout changes
John Lindgren [Fri, 31 Dec 2021 22:30:55 +0000 (17:30 -0500)]
Adjust views to account for output layout changes

labwc currently doesn't handle output layout changes very well:

 - Windows can end up "lost" completely offscreen
 - Maximized/fullscreen windows can end up spanning multiple outputs

Currently, new_output_notify() and output_destroy_notify() contain logic
to update the cursor and force a repaint when outputs are added or
removed.  This logic in fact needs to run on any output layout change,
so consolidate it into a new function, output_update_for_layout_change().

Then add a second new function, view_adjust_for_layout_change(), which
adjusts window placement to account for the new layout.

The behavior is roughly as follows:

 - Normal windows that end up offscreen are centered on the closest
   output (making use of the existing view_center() logic)
 - Maximized windows are re-maximized on the closest output.  Logic is
   also added to the unmaximize step to check that the original
   unmaximized position is still on-screen.
 - Fullscreen windows are re-fullscreened on the same output if
   possible; otherwise they are un-fullscreened.

Minimized windows don't require any special handling.  Their placement
is adjusted just the same, but invisible to the user until they are
later unminimized.

There is some positioning glitch still with un-fullscreening a window
whose output has been disconnected/disabled; it can end up in an
unexpected position (but at least has the correct size and decoration).
I don't think this is due to a bug in my change per se, but perhaps the
change has exposed a bug elsewhere.

Fixes: #177
4 years agobuild: bump version to 0.4.0
Johan Malm [Fri, 31 Dec 2021 21:05:49 +0000 (21:05 +0000)]
build: bump version to 0.4.0

4 years agoview.c: re-maximize views when toggling decorations
ARDiDo [Fri, 31 Dec 2021 17:09:20 +0000 (12:09 -0500)]
view.c: re-maximize views when toggling decorations

4 years agoxwayland: Implement request_activate
Joshua Ashton [Fri, 31 Dec 2021 02:58:55 +0000 (02:58 +0000)]
xwayland: Implement request_activate

Used by Steam, for example, on the Friends and Chat button.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agoxwayland: Implmement request_minimize
Joshua Ashton [Fri, 31 Dec 2021 02:45:19 +0000 (02:45 +0000)]
xwayland: Implmement request_minimize

This is used by Steam and other apps with client decorations.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agoxdg: Implement request_minimize
Joshua Ashton [Fri, 31 Dec 2021 02:44:25 +0000 (02:44 +0000)]
xdg: Implement request_minimize

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agodesktop: Fix activating unmapped views
Joshua Ashton [Fri, 31 Dec 2021 02:58:34 +0000 (02:58 +0000)]
desktop: Fix activating unmapped views

This can happen sometimes in xwayland, need to guard against this.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agoxwayland: Make styling of wl_signal_add consistent
Joshua Ashton [Fri, 31 Dec 2021 02:42:17 +0000 (02:42 +0000)]
xwayland: Make styling of wl_signal_add consistent

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agoxdg: Make styling of wl_signal_add consistent
Joshua Ashton [Fri, 31 Dec 2021 02:41:53 +0000 (02:41 +0000)]
xdg: Make styling of wl_signal_add consistent

Signed-off-by: Joshua Ashton <joshua@froggi.es>
4 years agoUpdate NEWS.md
Johan Malm [Wed, 29 Dec 2021 14:32:18 +0000 (14:32 +0000)]
Update NEWS.md

4 years agointeractive: use "grab" cursor when moving
Johan Malm [Wed, 29 Dec 2021 14:27:09 +0000 (14:27 +0000)]
interactive: use "grab" cursor when moving

This is consistent with sway and looks better.

Relates to issue #124

4 years agolabwc-environment(5): add XCURSOR_{THEME,SIZE}
Johan Malm [Wed, 29 Dec 2021 14:25:13 +0000 (14:25 +0000)]
labwc-environment(5): add XCURSOR_{THEME,SIZE}

4 years agolabwc-config(5): fix typo
Johan Malm [Wed, 29 Dec 2021 14:23:51 +0000 (14:23 +0000)]
labwc-config(5): fix typo

4 years agodocs/rc.xml.all: only declare one 'Root' context
Johan Malm [Wed, 29 Dec 2021 14:20:00 +0000 (14:20 +0000)]
docs/rc.xml.all: only declare one 'Root' context

Multiple <mousebind> can exist within one <context>, so let's keep it
clean.

4 years agoconfig: de-couple <FollowMouse> and <raiseOnFocus>
Johan Malm [Wed, 29 Dec 2021 14:04:41 +0000 (14:04 +0000)]
config: de-couple <FollowMouse> and <raiseOnFocus>

Set these two variables indepently of each other as this is cleaner and
more explicit.

In openbox <raiseOnFocus> only applies if <followMouse> is set, but there
is no need to immitate this.

4 years agosrc/foreign.c: verify associated view is still valid
Consolatis [Tue, 28 Dec 2021 05:08:35 +0000 (06:08 +0100)]
src/foreign.c: verify associated view is still valid

Closes #172

4 years agoview:c Do not overwrite unmaximized dimensions on fullscreen
Consolatis [Mon, 27 Dec 2021 23:55:34 +0000 (00:55 +0100)]
view:c Do not overwrite unmaximized dimensions on fullscreen

Before: window -> maximize -> fullscreen -> unfullscreen would reset pre maximized state
Now: window -> maximize -> fullscreen -> unfullscreen -> unmaximize works as expected

4 years agoFix build on Alpine Linux
Johan Malm [Tue, 28 Dec 2021 15:06:33 +0000 (15:06 +0000)]
Fix build on Alpine Linux

Issue #144

Add `#define _POSIX_C_SOURCE 200809L` to avoid the error below:

../src/cursor.c: In function 'cursor_update_focus':
../src/cursor.c:271:2: warning: implicit declaration of function
'clock_gettime' [-Wimplicit-function-declaration]
  271 |  clock_gettime(CLOCK_MONOTONIC, &now);
      |  ^~~~~~~~~~~~~
../src/cursor.c:271:16: error: 'CLOCK_MONOTONIC' undeclared (first use in
this function)
  271 |  clock_gettime(CLOCK_MONOTONIC, &now);
      |                ^~~~~~~~~~~~~~~
../src/cursor.c:271:16: note: each undeclared identifier is reported only
once for each function it appears in
../src/cursor.c: In function 'is_double_click':
../src/cursor.c:486:16: error: 'CLOCK_MONOTONIC' undeclared (first use in
this function)
  486 |  clock_gettime(CLOCK_MONOTONIC, &now);
      |                ^~~~~~~~~~~~~~~

4 years agoview.c: Remove 'activated' flag when minimizing a view
Consolatis [Mon, 27 Dec 2021 22:41:33 +0000 (23:41 +0100)]
view.c: Remove 'activated' flag when minimizing a view

Before this change a window that had been minimized showed up with states Minimized and Activated.
For foreign-toplevel clients like taskbars that could mean to handle multiple windows at once
having a 'activated' state even though they were clearly minimized.

4 years agoFix use-after-free errors detected by valgrind
John Lindgren [Mon, 27 Dec 2021 14:44:03 +0000 (09:44 -0500)]
Fix use-after-free errors detected by valgrind

Handlers for the "destroy" signal need to unregister themselves from the
signal (using wl_list_remove()) before invoking free().

    Invalid write of size 8
       at 0x487DF27: wl_list_remove (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x4906FF0: wlr_signal_emit_safe (signal.c:32)
       by 0x48EA304: reset_xdg_surface (wlr_xdg_surface.c:430)
       by 0x48EA3D6: UnknownInlinedFun (wlr_xdg_surface.c:464)
       by 0x48EA3D6: xdg_surface_handle_resource_destroy (wlr_xdg_surface.c:282)
       by 0x4877899: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487DEBF: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487E3DF: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487830D: wl_client_destroy (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x48783F6: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487B1C9: wl_event_loop_dispatch (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x4878D36: wl_display_run (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x110DAC: main (main.c:81)
     Address 0xc3213d8 is 424 bytes inside a block of size 704 free'd
       at 0x484118B: free (vg_replace_malloc.c:755)
       by 0x4906FDD: wlr_signal_emit_safe (signal.c:29)
       by 0x48EA304: reset_xdg_surface (wlr_xdg_surface.c:430)
       by 0x48EA3D6: UnknownInlinedFun (wlr_xdg_surface.c:464)
       by 0x48EA3D6: xdg_surface_handle_resource_destroy (wlr_xdg_surface.c:282)
       by 0x4877899: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487DEBF: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487E3DF: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487830D: wl_client_destroy (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x48783F6: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487B1C9: wl_event_loop_dispatch (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x4878D36: wl_display_run (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x110DAC: main (main.c:81)
     Block was alloc'd at
       at 0x48435FF: calloc (vg_replace_malloc.c:1117)
       by 0x113E22: xdg_surface_new (xdg.c:401)
       by 0x4906FDD: wlr_signal_emit_safe (signal.c:29)
       by 0x48EABE7: handle_xdg_surface_commit (wlr_xdg_surface.c:331)
       by 0x4908FE7: surface_commit_state (wlr_surface.c:457)
       by 0x524DD49: ??? (in /usr/lib/libffi.so.8.1.0)
       by 0x524D266: ??? (in /usr/lib/libffi.so.8.1.0)
       by 0x487D322: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x48785CB: ??? (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x487B1C9: wl_event_loop_dispatch (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x4878D36: wl_display_run (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x110DAC: main (main.c:81)

    Invalid write of size 8
       at 0x487DF27: wl_list_remove (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x4906FF0: wlr_signal_emit_safe (signal.c:32)
       by 0x48F5529: UnknownInlinedFun (wlr_input_device.c:34)
       by 0x48F5529: wlr_input_device_destroy (wlr_input_device.c:29)
       by 0x48CE4B5: backend_destroy.part.0.lto_priv.0 (backend.c:148)
       by 0x48D2D55: multi_backend_destroy (backend.c:59)
       by 0x48788FE: wl_display_destroy (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x110E71: UnknownInlinedFun (server.c:406)
       by 0x110E71: main (main.c:83)
     Address 0xc466568 is 24 bytes inside a block of size 56 free'd
       at 0x484118B: free (vg_replace_malloc.c:755)
       by 0x4906FDD: wlr_signal_emit_safe (signal.c:29)
       by 0x48F5529: UnknownInlinedFun (wlr_input_device.c:34)
       by 0x48F5529: wlr_input_device_destroy (wlr_input_device.c:29)
       by 0x48CE4B5: backend_destroy.part.0.lto_priv.0 (backend.c:148)
       by 0x48D2D55: multi_backend_destroy (backend.c:59)
       by 0x48788FE: wl_display_destroy (in /usr/lib/libwayland-server.so.0.20.0)
       by 0x110E71: UnknownInlinedFun (server.c:406)
       by 0x110E71: main (main.c:83)
     Block was alloc'd at
       at 0x48435FF: calloc (vg_replace_malloc.c:1117)
       by 0x11590F: new_input_notify (seat.c:137)
       by 0x4906FDD: wlr_signal_emit_safe (signal.c:29)
       by 0x4906FDD: wlr_signal_emit_safe (signal.c:29)
       by 0x48CDCEE: UnknownInlinedFun (events.c:109)
       by 0x48CDCEE: UnknownInlinedFun (events.c:242)
       by 0x48CDCEE: UnknownInlinedFun (backend.c:58)
       by 0x48CDCEE: handle_libinput_readable (backend.c:48)
       by 0x48CE1BE: backend_start.lto_priv.0 (backend.c:114)
       by 0x48D2CE5: multi_backend_start (backend.c:33)
       by 0x110C45: UnknownInlinedFun (server.c:375)
       by 0x110C45: main (main.c:68)

4 years agoFix coding style
Johan Malm [Sun, 26 Dec 2021 23:29:01 +0000 (23:29 +0000)]
Fix coding style

4 years agoCONTRIBUTING.md: wrap commit messages at 74 characters
Johan Malm [Sun, 26 Dec 2021 23:14:21 +0000 (23:14 +0000)]
CONTRIBUTING.md: wrap commit messages at 74 characters

4 years agoDelete .clang-format
Johan Malm [Sun, 26 Dec 2021 23:10:39 +0000 (23:10 +0000)]
Delete .clang-format

The file is not accurate and clang-format cannot describe our coding
style

4 years agodocs/rc.xml.all: update with default mouse-bindings
Johan Malm [Sun, 26 Dec 2021 23:02:07 +0000 (23:02 +0000)]
docs/rc.xml.all: update with default mouse-bindings

4 years agobuild: use wlroots 0.15.0
Johan Malm [Sun, 26 Dec 2021 22:42:51 +0000 (22:42 +0000)]
build: use wlroots 0.15.0

4 years agocursor: add cursor_update_focus()
Johan Malm [Sun, 26 Dec 2021 22:09:41 +0000 (22:09 +0000)]
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.

Inspired by PR #164 - just restructured it a bit.

Suggested-by: @bi4k8
4 years agocursor: fix setting of resize_edges
Johan Malm [Sun, 26 Dec 2021 21:35:37 +0000 (21:35 +0000)]
cursor: fix setting of resize_edges

Only calculate nearest `resize_edges` if not clear from the server-side
deco under the cursor.

4 years agodocument mouse buttons and newly-supported mouse contexts
bi4k8 [Sat, 11 Dec 2021 22:57:47 +0000 (22:57 +0000)]
document mouse buttons and newly-supported mouse contexts

4 years agoadd mouse bindings for window edges to rc.xml.all
bi4k8 [Sat, 11 Dec 2021 22:57:22 +0000 (22:57 +0000)]
add mouse bindings for window edges to rc.xml.all

4 years agomove edge resizing from hard-coded to configuration
bi4k8 [Sat, 11 Dec 2021 22:49:28 +0000 (22:49 +0000)]
move edge resizing from hard-coded to configuration

4 years agoimplement corner/edge mouse contexts
bi4k8 [Sat, 11 Dec 2021 22:48:28 +0000 (22:48 +0000)]
implement corner/edge mouse contexts

4 years agoCheck the return value of wlr_output_layout_get() for NULL
John Lindgren [Fri, 24 Dec 2021 20:53:49 +0000 (15:53 -0500)]
Check the return value of wlr_output_layout_get() for NULL

wlr_output_layout_get() seems to return NULL for disabled outputs.

Fixes: #174