Commit graph

741 commits

Author SHA1 Message Date
ARDiDo
59af8e0986 OSD: fix segfault when no app_id is set 2021-12-03 16:16:59 -05:00
Joshua Ashton
d568c60003 action: If we have a view that is an activator, use that instead of the current focus window
If we don't switch focus, we want the close button to close the window associated with it, not the current focus window.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-12-03 18:13:30 +00:00
Joshua Ashton
f9f9d809c8 cursor: Clear grabbed_view when switching from MOVE/GRAB
Better not to leave a dangling pointer to screw us over later.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-12-03 18:11:31 +00:00
Joshua Ashton
3e973c92ab interactive: Fix crash if a window is destroyed while moving it
Need to clean this up if it's our grabbed window!

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-12-03 18:11:31 +00:00
bi4k8
a9f11c5fc7 move window raise/focus on click from hard-coded logic to default mouse binding 2021-12-03 06:46:43 +00:00
bi4k8
11512d30af implement root menu display as a default mouse binding 2021-12-03 06:46:43 +00:00
bi4k8
fc0c06d4c4 implement Raise and Focus actions 2021-12-03 06:46:43 +00:00
bi4k8
3a3b484898 replace hard-coded ShowMenu on root button press with mouse binding trigger 2021-12-03 06:46:43 +00:00
bi4k8
0be4625c1c implement foreign toplevel activate 2021-12-03 06:43:34 +00:00
bi4k8
24215a3085 correctly detect when cursor is over titlebar
this was broken when we added ssd_part_types other than NONE that are not decoration
2021-12-03 06:42:04 +00:00
bi4k8
54e99cd240 forward click events to layer surfaces
this was broken when we moved to swallowing mouse events that triggered "Frame"-context mouse bindings. layer surfaces don't run mouse binding logic, so they need mouse events unconditionally forwarded.
2021-12-02 18:53:15 +00:00
bi4k8
a94fb3b225 fix interaction between Move action and click bindings
in order to allow the Move action to be bound to "press" on mouse binding contexts that also have "click" bindings, we should not short-circuit event processing when the input_mode is not passthrough (the "normal" mode). doing so seems to have been intended to prevent mouse bindings from being triggered during move/resize/menu interactions, but this does not seem to occur in practice. instead, `cursor_button`'s early return in this case caused the "release" side of "click" bindings to be ignored if their "press" side began an action that changes input_mode (e.g. Move).

the cleaner way to fix this interaction would be to use "drag" rather than "press" for Move bindings, but implementing "drag" is more complexity than I want to include in this changeset.

this change is its own commit to make it easy to bisect for, in case it causes regressions.
2021-12-02 17:58:31 +00:00
bi4k8
d8bbb751d2 handle mouse release bindings on root window 2021-12-02 17:58:31 +00:00
bi4k8
6b3320bcc1 do not add mouse bindings with no set context 2021-12-02 17:58:31 +00:00
bi4k8
347e6115e3 swallow mouse events only when bindings on Frame mouse contexts are triggered 2021-12-02 17:58:31 +00:00
bi4k8
d84103d669 define ssd_part_contains to define the mouse context subset relation 2021-12-02 17:58:31 +00:00
bi4k8
b008917895 implement handling for Client, Frame, and Root/Desktop (conflated for now) mouse contexts 2021-12-02 17:58:31 +00:00
bi4k8
4f6297d1ad parse menu names from Menu mouse-bindings 2021-12-01 23:17:19 +00:00
bi4k8
031ced85ef implement Resize as an action
this requires action() to know the resize edges to use, so thread them through
2021-12-01 22:45:20 +00:00
bi4k8
8eab1e8132 parse and respect modifiers for mouse bindings 2021-12-01 15:11:21 -05:00
bi4k8
c34a2fc976 make parse_modifiers public 2021-12-01 15:11:21 -05:00
bi4k8
ef49d2c843 be stricter about what counts as a double-click 2021-12-01 07:57:33 +00:00
bi4k8
58ed11c99c fix signal handlers
avoid segfaulting sigint/sigterm handlers and drop an unused argument from sighup handler
2021-12-01 07:12:37 +00:00
Johan Malm
05237ed1cb docs/autostart: add swayidle example 2021-11-28 22:54:22 +00:00
Johan Malm
9eaa5a92a1 cursor: support XCURSOR_THEME and XCURSOR_SIZE
Use environment variables XCURSOR_THEME and XCURSOR_SIZE to set cursor
theme and size respectively. Default size is 24.

Find icons themes with the command below or similar:

    find /usr/share/icons/ -type d -name "cursors"
2021-11-28 22:50:37 +00:00
Johan Malm
afa299c080 cursor.c: rebase cursor when exiting interactive mode
cursor_rebase() sets the cursor icon and sends a motion-event to the
surface below the cursor. It is made public in anticipation of using it
in various view_* functions.
2021-11-28 22:14:23 +00:00
Johan Malm
1c831bc051 interactive.c: set move/resize cursor
Fixes issue #124
2021-11-28 21:47:24 +00:00
John Lindgren
4d92391246 Fix graphical artifacts after adding/removing outputs
When an output is added or removed, the position of the other
outputs can also change, resulting in windows moving between them.
We need to redraw all the outputs (not just the new one) to prevent
stale/corrupted screen contents.
2021-11-28 08:32:45 +00:00
ARDiDo
c5b8688894 Title repainting: move call to damage_all_outputs() to view_update() 2021-11-27 14:35:27 -05:00
John Lindgren
816a61b2fa Fix invisible cursor at startup 2021-11-27 14:31:23 -05:00
John Lindgren
1bd26d259a Force repaint after window title changes
When a window title changed dynamically (for example when running
"cd" within an xfce4-terminal), the titlebar did not immediately
update to show the new title.  (The titlebar would update as soon
as the mouse cursor moved.)
2021-11-27 14:20:37 -05:00
Johan Malm
d50c2f2eac Fix minor style violations 2021-11-26 19:27:50 +00:00
Johan Malm
bca57213a0 Remove min/max macros
...and replace with a local MAX macro, because:

- They contain a ({}) construct which is a GNU extension and that's
  against Drew's coding style
- min() is not used anyway
- MAX() clashes with cairo's macro, so best to not add this in labwc.h
2021-11-26 19:16:00 +00:00
Johan Malm
b7c326ec6f view.c: fix coding style 2021-11-26 18:57:25 +00:00
Johan Malm
2bea203430 docs/rc.xml.all: add TitleBar Left-Press mousebind
<context name="TitleBar">
  <mousebind button="Left" action="Press">
    <action name="Move"/>
  </mousebind>
</context>
2021-11-26 18:30:58 +00:00
Johan Malm
12137ba446 labwc-action(5): add "Move" action 2021-11-26 18:30:11 +00:00
John Lindgren
c01d1f124c Basic support for Move action
- Add Move as a default mouse binding for a Titlebar Press action
- Remove the hard-coded handling in cursor_button()

Example config snippet:

    <mouse>
      <context name="Titlebar">
        <mousebind button="Left" action="Press">
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Move"/>
        </mousebind>
      </context>
    </mouse>
2021-11-26 18:25:04 +00:00
John Lindgren
687993370f Enable new outputs (before setting mode)
Fixes the following error with wlroots-git 0.14.0.r391.g585a908a-1:

    [DEBUG] [types/output/output.c:603] Tried to modeset a disabled output
2021-11-26 16:13:58 +00:00
ARDiDo
6f2f79b8d7 HiDPI: fix move_to_edge and snap_to_edge 2021-11-24 17:33:10 -05:00
ARDiDo
ed3d0cd523 HiDPI: fix osd placement and maximized scale 2021-11-24 17:33:10 -05:00
ARDiDo
6698ca7300 HiDPI: send enter and leave events to views when switching monitors 2021-11-24 17:33:10 -05:00
ARDiDo
1d92404108 HiDPI: send output_enter events to views when they open 2021-11-24 17:33:10 -05:00
ARDiDo
aa9720f627 Add support for basic idle and idle inhibitor protocols 2021-11-22 21:58:07 +00:00
Jan Beich
3e5458fa24 server: chase swaywm/wlroots@fdf3169b41
ld: error: undefined symbol: wlr_backend_get_renderer
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_rect)
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_rect)
>>> referenced by output.c
>>>               labwc.p/src_output.c.o:(render_texture)
>>> referenced 5 more times

Based on 5865af75cf
Based on a6538ced35
2021-11-21 07:52:19 +00:00
Johan Malm
0a6ab7cd35 README: make openbox link point to openbox.org 2021-11-13 22:29:14 +00:00
Johan Malm
fd85344b2d README: add lavalauncher to recommended apps 2021-11-13 22:28:28 +00:00
Johan Malm
cb050dc62b README: explain meaning of lab further 2021-11-13 22:28:01 +00:00
Johan Malm
12fb562682 docs/labwc-menu.5.scd: describe submenus 2021-11-13 22:19:52 +00:00
01micko
1c5b5c25c5 docs/labwc-menu.5.scd: fix menu definition
This is in line with 1a38cc8 and #109
2021-11-13 22:02:46 +00:00
Johan Malm
e227de1346 Add SPDX identifiers 2021-11-13 21:56:53 +00:00