]> git.mdlowis.com Git - proto/labwc.git/log
proto/labwc.git
3 years agoNEWS.md: update notes on 0.6.0
Johan Malm [Thu, 17 Nov 2022 20:51:38 +0000 (20:51 +0000)]
NEWS.md: update notes on 0.6.0

3 years agoci: add hwdata
Johan Malm [Thu, 17 Nov 2022 21:26:18 +0000 (21:26 +0000)]
ci: add hwdata

3 years agowlroots.wrap: use 0.16.0
Johan Malm [Tue, 15 Nov 2022 22:41:53 +0000 (22:41 +0000)]
wlroots.wrap: use 0.16.0

3 years agoRefuse to start when SUID is detected
Johan Malm [Fri, 14 Oct 2022 22:27:42 +0000 (23:27 +0100)]
Refuse to start when SUID is detected

This ensures that those surprised by the deprecation of SUID operation
receive an error rather than accidentally having run as root.

swaywm/sway@e572805

3 years agoupdate repeat rate of all keyboard input devices, not keyboard group's keyboard
bi4k8 [Wed, 9 Nov 2022 20:31:45 +0000 (20:31 +0000)]
update repeat rate of all keyboard input devices, not keyboard group's keyboard

without this patch, reconfiguring keyboard repeat rate/delay at runtime does not work

3 years agocursor: combine two variables relating to frame-context
Johan Malm [Mon, 7 Nov 2022 20:26:37 +0000 (20:26 +0000)]
cursor: combine two variables relating to frame-context

Mouse bindings, unlike key bindings, are made within contexts which
represent what was clicked/dragged.  The context 'Frame' refers to the
entire window frame including both the window decorations (if any) and the
client window itself. It is typically used for alti + left/right click to
move/resize the window.

'Frame' is a special case in that when a button is bound in this
context, the action will not be forwarded to the client, which is what
we describe with the 'consumed_by_frame_context' variable.

3 years agooutput: test adaptive sync
Johan Malm [Sat, 12 Nov 2022 15:51:46 +0000 (15:51 +0000)]
output: test adaptive sync

Required by https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3637
See also swaywm/sway@07bfeb2

Fixes #516

3 years agoSupport smooth scroll and horizontal scroll
bi4k8 [Wed, 9 Nov 2022 05:18:14 +0000 (05:18 +0000)]
Support smooth scroll and horizontal scroll

note that this changes Scroll mousebinds from taking a "button"
attribute to taking a "direction" attribute

3 years agocursor: Make update_pressed_surface() no-op except during grabs
John Lindgren [Tue, 15 Nov 2022 19:20:05 +0000 (14:20 -0500)]
cursor: Make update_pressed_surface() no-op except during grabs

This matches Weston behavior more closely and fixes Firefox context
menus.

3 years agoview: survive setting fullscreen with no outputs
Johan Malm [Sat, 12 Nov 2022 16:13:20 +0000 (16:13 +0000)]
view: survive setting fullscreen with no outputs

Fixes #608

3 years agosrc/config/rcxml.c: distinguish no and unknown font places
bi4k8 [Wed, 9 Nov 2022 22:41:31 +0000 (22:41 +0000)]
src/config/rcxml.c: distinguish no and unknown font places

Currently, the `rc.xml` parser applies font settings in a `<font>` tag with an
unknown value for its `place` attribute to all fonts. This means that whatever
the final unknown-`place` `<font>` tag is in a user's `rc.xml` applies to all
text drawn by labwc.

Instead, only treat `<font>` tags with an empty or missing `place` attribute as
applying globally, and warn when encountering unknown `place` attribute values
(which will help us find font places to support).

3 years agokeyboard: use 1000/rate msecs for keybind repeat event source delay
bi4k8 [Wed, 9 Nov 2022 20:29:48 +0000 (20:29 +0000)]
keyboard: use 1000/rate msecs for keybind repeat event source delay

3 years agofix typo
bi4k8 [Wed, 9 Nov 2022 20:27:47 +0000 (20:27 +0000)]
fix typo

3 years agosrc/cursor.c: Use 'handled' for state of consumed cursor actions
Arnaud Vallette d'Osia [Sat, 5 Nov 2022 18:54:00 +0000 (19:54 +0100)]
src/cursor.c: Use 'handled' for state of consumed cursor actions

3 years agoScroll-Bindings: Add docs
Arnaud Vallette d'Osia [Sun, 6 Nov 2022 20:14:11 +0000 (21:14 +0100)]
Scroll-Bindings: Add docs

3 years agoScroll-Bindings: Add default config
Arnaud Vallette d'Osia [Sun, 6 Nov 2022 20:13:57 +0000 (21:13 +0100)]
Scroll-Bindings: Add default config

By default we switch workspaces when scrolling
on the desktop to match the Openbox behavior.

3 years agoScroll-Bindings: Add support for mouse wheel bindings
Arnaudv6 [Tue, 25 Oct 2022 19:46:46 +0000 (21:46 +0200)]
Scroll-Bindings: Add support for mouse wheel bindings

3 years agoFix coding style
Johan Malm [Thu, 3 Nov 2022 19:58:21 +0000 (19:58 +0000)]
Fix coding style

3 years agocheckpatch: ignore += UNNECESSARY_ELSE
Johan Malm [Thu, 3 Nov 2022 19:44:28 +0000 (19:44 +0000)]
checkpatch: ignore += UNNECESSARY_ELSE

3 years agocheckpatch: add scripts/check for batch processing
Johan Malm [Fri, 14 Oct 2022 22:16:01 +0000 (23:16 +0100)]
checkpatch: add scripts/check for batch processing

Co-Authored-By: @Consolatis
3 years agocheckpatch: patch to suit labwc coding style
Johan Malm [Tue, 1 Nov 2022 20:48:16 +0000 (20:48 +0000)]
checkpatch: patch to suit labwc coding style

Coding style specific changes include:

- Accept pango, glib and libxml2 CamelCase variables
- Remove "need consistent spacing around '*'" warning
- Do not warn about "structs that should be const"
- Do not warn on braces {} around single statements
- Do not warn about braces {} for single statement blocks
- Do not warn about wanting { on previous line for functions
- Remove check for missing blank line after declaration
- Ignore SPLIT_STRING COMPLEX_MACRO PREFER_KERNEL_TYPES
  LOGICAL_CONTINUATIONS PARENTHESIS_ALIGNMENT OPEN_ENDED_LINE
  MACRO_ARG_REUSE PREFER_FALLTHROUGH ARRAY_SIZE INITIALISED_STATIC

Other changes include:

- Do not complain about missing spelling.txt
- Print filename for each file, but no summary line

3 years agocheckpatch: import checkpatch.pl from Linux kernel
Johan Malm [Tue, 1 Nov 2022 20:45:55 +0000 (20:45 +0000)]
checkpatch: import checkpatch.pl from Linux kernel

https://raw.githubusercontent.com/torvalds/linux/4ce9f970457899defdf68e26e0502c7245002eb3/scripts/checkpatch.pl

3 years agoChase wlroots: output test assert
Consolatis [Thu, 3 Nov 2022 17:54:49 +0000 (18:54 +0100)]
Chase wlroots: output test assert

This fixes an assert on output test when
running with the headless backend.

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 05454618cd2d49fb3a5f0c560b0d2c455cf32467
xwayland: split headers

Fixes #605

3 years agokeyboard: Implement key repeat for keybindings
John Lindgren [Wed, 2 Nov 2022 20:37:24 +0000 (16:37 -0400)]
keyboard: Implement key repeat for keybindings

It seems that every Wayland client is expected to implement its own
key-repeat logic, rather than doing it server-side as in X11.  This
means that labwc also has to implement its own key-repeat logic for
compositor keybindings.

This is a very simplistic timer-based implementation.  It doesn't
attempt to synthesize accurate timestamps, and may lag depending
on system load, but it appears to get the job done.

v2: Use server->wl_event_loop
v3: Comments and formatting

3 years agokey-state: Prevent array overflow
John Lindgren [Wed, 2 Nov 2022 20:26:33 +0000 (16:26 -0400)]
key-state: Prevent array overflow

- Prevent adding the same keycode more than once
- Prevent adding more keycodes than MAX_PRESSED_KEYS

3 years agosrc/menu/menu.c: Add comments
Consolatis [Tue, 1 Nov 2022 16:50:39 +0000 (17:50 +0100)]
src/menu/menu.c: Add comments

3 years agoREADME: add link to pre-0.6.0 video
Johan Malm [Mon, 31 Oct 2022 17:02:57 +0000 (17:02 +0000)]
README: add link to pre-0.6.0 video

3 years agorcxml.c: combine common code in fill_{key,mouse}bind()
Johan Malm [Sun, 30 Oct 2022 14:26:57 +0000 (14:26 +0000)]
rcxml.c: combine common code in fill_{key,mouse}bind()

3 years agorcxml.c: support 'to.action' in mousebind
Johan Malm [Sun, 30 Oct 2022 14:23:10 +0000 (14:23 +0000)]
rcxml.c: support 'to.action' in mousebind

...in support to specifying 'left', 'right' and so on with actions
GoToDesktop and SendToDesktop.

For example:

    <mouse>
      <default/>
      <context name="Desktop">
        <mousebind button="Up" action="Scroll">
          <action name="GoToDesktop" to="left"/>
        </mousebind>
        <mousebind button="Down" action="Scroll">
          <action name="GoToDesktop" to="right"/>
        </mousebind>
      </context>
    </mouse>

3 years agoxwayland: Hide unmanaged nodes on unmap()
John Lindgren [Thu, 27 Oct 2022 17:53:50 +0000 (13:53 -0400)]
xwayland: Hide unmanaged nodes on unmap()

Since xwayland commit 9e4b7948df5a9a67632bb606150ec171b5519672
there is a one-second delay between XWayland surfaces being
unmapped and destroyed.  This revealed that we were not actually
handling the unmap() signal correctly for unmanaged surfaces.

3 years agocursor: Restore drag icon after the move to scene-graph
Consolatis [Sun, 18 Sep 2022 03:40:52 +0000 (05:40 +0200)]
cursor: Restore drag icon after the move to scene-graph

Also move everything DnD related to src/dnd.c

3 years agoAdd --exit and --reconfigure
Johan Malm [Thu, 6 Oct 2022 20:54:49 +0000 (21:54 +0100)]
Add --exit and --reconfigure

3 years agoAdd long command line options
Johan Malm [Thu, 6 Oct 2022 20:54:26 +0000 (21:54 +0100)]
Add long command line options

3 years agoserver: do not set WAYLAND_DISPLAY twice
Johan Malm [Tue, 4 Oct 2022 20:58:58 +0000 (21:58 +0100)]
server: do not set WAYLAND_DISPLAY twice

3 years agolabwc(1): describe SIGTERM and SIGHUP
Johan Malm [Tue, 4 Oct 2022 20:57:38 +0000 (21:57 +0100)]
labwc(1): describe SIGTERM and SIGHUP

3 years agoSet environment variable LABWC_PID
Johan Malm [Tue, 4 Oct 2022 20:48:57 +0000 (21:48 +0100)]
Set environment variable LABWC_PID

...to the pid of the compositor so that SIGHUP and SIGTERM can be sent to
specific instances using `kill -s <signal> <pid>` rather than
`killall -s <signal> labwc`

Issue #573

3 years agobuild: simplify protocol paths
Johan Malm [Fri, 14 Oct 2022 21:44:51 +0000 (22:44 +0100)]
build: simplify protocol paths

No need for arrays here.

swaywm/sway@04f8a65

3 years agocursor: Call wlr_seat_pointer_notify_clear_focus() only if needed
John Lindgren [Tue, 11 Oct 2022 15:46:30 +0000 (11:46 -0400)]
cursor: Call wlr_seat_pointer_notify_clear_focus() only if needed

@Consolatis determined that apparently the extra "clear focus"
event confuses the drag source during drag-and-drop.

Fixes drag-and-drop of files into folders within the same Thunar
window.

3 years agoChase wlroots: unreadable displays
01micko [Fri, 7 Oct 2022 22:58:28 +0000 (08:58 +1000)]
Chase wlroots: unreadable displays

This fixes an issue of unreadable displays in some
multiple output configurations.

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 694e9bbb9d7114f39311d93e885e010606a88dae
backend/drm: allocate connector CRTC on lease creation

Fixes #583

3 years agoCONTRIBUTING.md: describe coding style more accurately
Johan Malm [Fri, 30 Sep 2022 20:28:59 +0000 (21:28 +0100)]
CONTRIBUTING.md: describe coding style more accurately

- Clarify the coding style relative to Linux kernel and Devault rules
- Add g_pattern_match_simple() example
- Add namespace advice and preference
- Elaborate on preferred header documentation style.
- Add table of contents
- Simplify API section and add wl_list_append()

3 years agos/wl_list_insert(list.prev...)/wl_list_append(list...)/
Consolatis [Wed, 5 Oct 2022 06:43:56 +0000 (08:43 +0200)]
s/wl_list_insert(list.prev...)/wl_list_append(list...)/

3 years agocommon: add wl_list_append()
Johan Malm [Tue, 4 Oct 2022 21:04:09 +0000 (22:04 +0100)]
common: add wl_list_append()

3 years agoNEWS.md: update notes on 0.6.0
Johan Malm [Thu, 29 Sep 2022 22:39:27 +0000 (23:39 +0100)]
NEWS.md: update notes on 0.6.0

3 years agoCI: Switch Void mirror to repo-ci.voidlinux.org
Consolatis [Fri, 30 Sep 2022 00:21:59 +0000 (02:21 +0200)]
CI: Switch Void mirror to repo-ci.voidlinux.org

3 years agoChase wlroots: output cursor
Consolatis [Wed, 21 Sep 2022 19:14:57 +0000 (21:14 +0200)]
Chase wlroots: output cursor

To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots 68c8cef38edafa5e52532e0b43a4888554168361
cursor: Don't warp to (0,0) when last output is disconnected

Fixes #561

3 years agoCI: FreeBSD switch from 'quarterly' to 'latest'
Consolatis [Thu, 29 Sep 2022 06:04:38 +0000 (08:04 +0200)]
CI: FreeBSD switch from 'quarterly' to 'latest'

Latest wlroots requires libdrm-2.4.113 but 'quarterly' only
provides libdrm-2.4.112. Switch to 'latest' to fix this.

3 years agosrc/osd.c: Ensure destroying views are not used as preview anchors
Consolatis [Mon, 26 Sep 2022 08:58:13 +0000 (10:58 +0200)]
src/osd.c: Ensure destroying views are not used as preview anchors

3 years agosrc/osd.c: Prevent showing invalid windows
Consolatis [Mon, 26 Sep 2022 01:48:02 +0000 (03:48 +0200)]
src/osd.c: Prevent showing invalid windows

This might happen when closing the last
application "to tray" like VLC, Discord or Steam.

Reported-by: @Flrian
3 years agokeyboard: put modifier/key listeners in keyboard struct
Johan Malm [Mon, 26 Sep 2022 06:17:19 +0000 (07:17 +0100)]
keyboard: put modifier/key listeners in keyboard struct

...so that it can be determined what wlr_keyboard events come from.

This is required to manage virtual keyboards alongside the keyboard_group
of physical keyboards.

3 years agoseat: implement virtual keyboard protocol
Joshua Ashton [Wed, 17 Aug 2022 18:23:06 +0000 (18:23 +0000)]
seat: implement virtual keyboard protocol

3 years agoseat: implement virtual pointer protocol
Joshua Ashton [Wed, 17 Aug 2022 18:17:21 +0000 (18:17 +0000)]
seat: implement virtual pointer protocol

3 years agoseat: add seat_add_device helper
Joshua Ashton [Wed, 17 Aug 2022 18:16:16 +0000 (18:16 +0000)]
seat: add seat_add_device helper

3 years agoseat: add seat_update_capabilities helper
Joshua Ashton [Wed, 17 Aug 2022 18:12:24 +0000 (18:12 +0000)]
seat: add seat_update_capabilities helper

3 years agoview: no gap for top/left align big window
Johan Malm [Mon, 26 Sep 2022 19:16:43 +0000 (20:16 +0100)]
view: no gap for top/left align big window

On initial positioning of toplevel windows we call view_center().
During the centering process, if it turns out that the view is larger than
the output usable-area then we just top/left align it with no gap.

Relates to the gap aspect of issue #403

Reported-by: @Flrian
3 years agoCI: Add Debian testing
Consolatis [Fri, 23 Sep 2022 19:08:27 +0000 (21:08 +0200)]
CI: Add Debian testing

3 years agoFix minor coding-style violations
Johan Malm [Sat, 17 Sep 2022 11:31:07 +0000 (12:31 +0100)]
Fix minor coding-style violations

...based on https://github.com/johanmalm/checkpatch.pl

3 years agoCONTRIBUTING.md: improve all sections
Johan Malm [Sat, 17 Sep 2022 11:41:39 +0000 (12:41 +0100)]
CONTRIBUTING.md: improve all sections

...including guidelines on:

- the use of glib
- the use of GNU C extensions
- what commit messages should look like
- coding-style

3 years agocursor: Prevent setting cursor icon on drag
Consolatis [Wed, 21 Sep 2022 05:42:34 +0000 (07:42 +0200)]
cursor: Prevent setting cursor icon on drag

Partly fixes #549

3 years agoMerge pull request #438 from johanmalm/fix/repeat
Johan Malm [Wed, 21 Sep 2022 20:35:06 +0000 (21:35 +0100)]
Merge pull request #438 from johanmalm/fix/repeat

Revert "keyboard: cancel repeat when handling key-bind" and
only pass on pressed+sent keycodes to surfaces on keyboard-focus.

3 years agoseat: only pass on sent keys on surface-focus
Johan Malm [Tue, 20 Sep 2022 19:46:39 +0000 (20:46 +0100)]
seat: only pass on sent keys on surface-focus

Key events associated with keybindings (both pressed and released) are not
sent to clients. When using wlr_seat_keyboard_notify_enter() it it
therefore important not to send the keycodes of _all_ pressed keys, but
only those that were actually _sent_ to clients (that is, those that were
not bound).

This approach is consistent with sway's implementation in input/seat.c
https://github.com/swaywm/sway/blob/cffb006feba52c318e66f73c3463032fa76782dc/sway/input/seat.c#L173-L175

Fixes issue #510

3 years agosrc/keyboard.c: register keys before inhibit check
Johan Malm [Tue, 30 Aug 2022 20:07:27 +0000 (21:07 +0100)]
src/keyboard.c: register keys before inhibit check

Call key_state_set_pressed() before checking
seat->active_client_while_inhibited to avoid missing release events for
clients using the inhibit protocol (for example swaylock).

3 years agosrc/keyboard.c: do not end window-cycling on modifier release only
Johan Malm [Tue, 30 Aug 2022 14:47:00 +0000 (15:47 +0100)]
src/keyboard.c: do not end window-cycling on modifier release only

If a user lets go of the modifier (e.g. alt) before the 'normal' key (e.g.
tab) when window-cycling, we do not end the cycling until both keys have
been released.  If we end the window-cycling on release of the modifier
only, some XWayland clients such as hexchat realise that tab is pressed
(even though we did not forward the event) and because we absorb the
equivalent release event it gets stuck on repeat.

Just to clarify the position here: Issue #176 describes a behaviour
whereby dmenu gets stuck on repeat after being launched with a keybind.
This patch does not resolve that issue but reflects that in Wayland, the
client is responsible for implementing "key repeat".

Changing the key repeat rate/delay in (labwc/labwc@e62bb51) was dirty fix
that need should never have been made.

3 years agooutput: Call do_output_layout_change() at end of new_output_notify().
John Lindgren [Tue, 20 Sep 2022 05:17:22 +0000 (01:17 -0400)]
output: Call do_output_layout_change() at end of new_output_notify().

This fixes an issue with the wlr_output_cursor not being properly
initialized on new outputs, because wlr_output_layout.events.change
is triggered too soon, before the wlr_output_cursor exists.

3 years agosrc/menu.c: Clamp separator width
Consolatis [Tue, 20 Sep 2022 00:04:57 +0000 (02:04 +0200)]
src/menu.c: Clamp separator width

Reported-by: @Flrian
3 years agosrc/keyboard.c: reflow comment to shorten line
Johan Malm [Tue, 30 Aug 2022 14:43:57 +0000 (15:43 +0100)]
src/keyboard.c: reflow comment to shorten line

3 years agosrc/keyboard.c: stored handled keys as bound when window-cycling
Johan Malm [Tue, 30 Aug 2022 14:41:50 +0000 (15:41 +0100)]
src/keyboard.c: stored handled keys as bound when window-cycling

...and changing TTY

3 years agoRevert "keyboard: cancel repeat when handling key-bind"
Johan Malm [Mon, 11 Jul 2022 16:05:08 +0000 (17:05 +0100)]
Revert "keyboard: cancel repeat when handling key-bind"

This reverts commit e62bb51bfb33ee520e800cf98553d766824fe9cf.

Fixes #510

3 years agoMerge pull request #552 from jlindgren90/xmalloc
Consolatis [Mon, 19 Sep 2022 03:43:55 +0000 (05:43 +0200)]
Merge pull request #552 from jlindgren90/xmalloc

common: Add more friendly memory utilities

3 years agocommon: Expand comment for znew/znew_n()
John Lindgren [Sun, 18 Sep 2022 21:30:12 +0000 (17:30 -0400)]
common: Expand comment for znew/znew_n()

3 years agocommon: Add znew/znew_n() macros
John Lindgren [Sun, 18 Sep 2022 19:22:26 +0000 (15:22 -0400)]
common: Add znew/znew_n() macros

3 years agokeyboard: Fix SIGSEGV that showed up in out-of-memory fuzzing
John Lindgren [Sat, 17 Sep 2022 18:47:47 +0000 (14:47 -0400)]
keyboard: Fix SIGSEGV that showed up in out-of-memory fuzzing

Stack trace:

    #0  xkb_keymap_ref (keymap=keymap@entry=0x0) at ../libxkbcommon/src/keymap.c:61
    #1  0x00007f53a344ab99 in wlr_keyboard_set_keymap (kb=kb@entry=0x5571af8cb9a0, keymap=keymap@entry=0x0)
        at ../types/wlr_keyboard.c:174
    #2  0x00005571ade057e0 in keyboard_init (seat=0x7ffca0389680) at ../src/keyboard.c:229
    #3  seat_init (server=0x7ffca0389570) at ../src/seat.c:307
    #4  server_init (server=0x7ffca0389570) at ../src/server.c:308

3 years agoaction: Fix warning about freeing a (const char *)
John Lindgren [Fri, 16 Sep 2022 22:45:02 +0000 (18:45 -0400)]
action: Fix warning about freeing a (const char *)

3 years agocommon: Add additional memory utilities (xzalloc() etc.)
John Lindgren [Fri, 16 Sep 2022 22:41:02 +0000 (18:41 -0400)]
common: Add additional memory utilities (xzalloc() etc.)

3 years agoaction: Allow explicit None action without warning
John Lindgren [Tue, 6 Sep 2022 17:22:43 +0000 (13:22 -0400)]
action: Allow explicit None action without warning

3 years agocursor: Use enum for server set cursor names
Consolatis [Fri, 16 Sep 2022 00:23:44 +0000 (02:23 +0200)]
cursor: Use enum for server set cursor names

This mainly prevents having to use strcmp() on every mouse move.

3 years agocursor: Move cursor specific function definitions into cursor.h
Consolatis [Fri, 16 Sep 2022 00:03:32 +0000 (02:03 +0200)]
cursor: Move cursor specific function definitions into cursor.h

3 years agoseat: Fix use-after-free in touch_finish()
John Lindgren [Fri, 16 Sep 2022 00:02:06 +0000 (20:02 -0400)]
seat: Fix use-after-free in touch_finish()

3 years agokeyboard: Fix use-after-free in keyboard_finish()
John Lindgren [Thu, 15 Sep 2022 23:50:07 +0000 (19:50 -0400)]
keyboard: Fix use-after-free in keyboard_finish()

3 years agoaction: Select resize edges for Resize triggered by keybind
John Lindgren [Thu, 15 Sep 2022 12:31:37 +0000 (08:31 -0400)]
action: Select resize edges for Resize triggered by keybind

3 years agocursor: Split out cursor_button_press() and cursor_button_release()
John Lindgren [Wed, 14 Sep 2022 18:49:09 +0000 (14:49 -0400)]
cursor: Split out cursor_button_press() and cursor_button_release()

3 years agoconfig: s/OSD/OnScreenDisplay/ in <theme><font place="OSD">
Johan Malm [Thu, 15 Sep 2022 21:03:52 +0000 (22:03 +0100)]
config: s/OSD/OnScreenDisplay/ in <theme><font place="OSD">

...to comply with Openbox 3.6 spec [1]

"OSD" is still honoured to maintain backward compatibility.

[1]: http://openbox.org/wiki/Help:Configuration#Theme

3 years agoconfig: Add support for font slant and weight
John Lindgren [Thu, 15 Sep 2022 14:53:49 +0000 (10:53 -0400)]
config: Add support for font slant and weight

3 years agocursor: Store view + resize edges for move/resize in press event
John Lindgren [Thu, 15 Sep 2022 03:09:36 +0000 (23:09 -0400)]
cursor: Store view + resize edges for move/resize in press event

v2: Restore previous behavior for keybinds

3 years agocursor: Add struct cursor_context and clean up code
John Lindgren [Mon, 12 Sep 2022 08:54:00 +0000 (04:54 -0400)]
cursor: Add struct cursor_context and clean up code

v2:
 - Add surface to cursor_context, rename c -> ctx
 - Factor out determine_resize_edges()

3 years agoMerge pull request #533 from jlindgren90/fix-gtk-menus
Consolatis [Wed, 14 Sep 2022 04:03:17 +0000 (06:03 +0200)]
Merge pull request #533 from jlindgren90/fix-gtk-menus

cursor: Fix GTK3 menus when keeping the button pressed

3 years agocursor: Allow leave/enter events within the same XDG toplevel
John Lindgren [Sat, 10 Sep 2022 05:57:39 +0000 (01:57 -0400)]
cursor: Allow leave/enter events within the same XDG toplevel

Attempting to open a GTK3 menu and activate a menu item in it,
using a single mouse motion (press-move-release), was broken due
to GTK apparently expecting to receive leave/enter events when the
cursor enters the menu (XDG popup).

To fix the issue, allow leave/enter events when the cursor is
moved between an XDG toplevel and popups of the same.

v2:
 - Use (struct view *) as proxy for toplevel in comparisons
 - Update seat->pressed.surface when entering/leaving popups
v3:
 - Go back to using get_toplevel() rather than (struct view *)

3 years agoxdg-popup: Check for NULL from wlr_xdg_surface_from_wlr_surface()
John Lindgren [Tue, 13 Sep 2022 16:51:23 +0000 (12:51 -0400)]
xdg-popup: Check for NULL from wlr_xdg_surface_from_wlr_surface()

Also eliminate struct view_child and replace it with a simple
(struct view *)parent_view field.

3 years agoseat: Listen for destroy signal of pressed.surface
John Lindgren [Tue, 13 Sep 2022 14:55:59 +0000 (10:55 -0400)]
seat: Listen for destroy signal of pressed.surface

3 years agoMerge pull request #540 from jlindgren90/cursor-fixes
Consolatis [Tue, 13 Sep 2022 18:55:32 +0000 (20:55 +0200)]
Merge pull request #540 from jlindgren90/cursor-fixes

cursor: Factor out cursor_update_common() and fix some glitches

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