Commit graph

1657 commits

Author SHA1 Message Date
Johan Malm
c4b9173afd checkpatch.pl: check single statement brace 2023-08-11 21:54:52 +01:00
Johan Malm
b149526d03 foreign: set parent
Tested with wlroots/examples/foreign-toplevel.c

Helped-by: @Consolatis
2023-08-11 07:53:19 +02:00
Johan Malm
2b9a6914a6 button: move button-png.c to button/
...so that all button code is in the same place.
2023-08-10 16:33:03 +01:00
Johan Malm
03bc2ada47 button: refactor xbm code
- Rename src/xbm/ to src/button/
- Combine xbm.c parse.c tokenize.c into button-xbm.c

No functional change
2023-08-10 16:33:03 +01:00
Johan Malm
3111c57d6f cursor: cancel popup grab on mouse-press outside client itself
...for example on any part of the server side decoration

Supercedes #826 for xdg-shell popups

Helped-by: @Consolatis
2023-08-10 15:33:56 +01:00
Consolatis
e39744f1d3 Add keepBorder <theme> option and enable it by default
With the new keepBorder option enabled, the
ToggleDecorations action now has 3 states:

- the first time only disables the titlebar
- the second time disables the whole SSD
- the third time enables the whole SSD again

When the keepBorder action is disabled, the old 2-state
behavior is restored, e.g. the ToggleDecorations action
only toggles between on and off.

Fixes #813
2023-08-10 16:09:20 +02:00
Johan Malm
a6a03daae3 Support png buttons
In the theme directory add close-{active,inactive}.png instead of
close.xbm - and similarly for iconify, menu and max.
2023-08-09 07:38:17 +01:00
Johan Malm
eca98a9b6e theme: simplify loading of xbm buttons
No functional change.
2023-08-09 07:38:17 +01:00
Consolatis
7a19184e5e src/cursor.c: end popup grab on desktop click
Fixes #949
2023-08-07 09:59:30 +02:00
Consolatis
43db75f43c Restore SnapToEdge and MoveToEdge default keybinds
When adding the fallback keybinds we add them as string but expect them being an int.
This commit fixes that by using the same parsing routines that are used when parsing
user supplied configuration.

Fixes 1ee8715d57
actions: use enum for _ToEdge action
2023-08-06 10:37:36 +02:00
Consolatis
8d0ee4811b Fix crash when using _ToEdge actions when using the default keybinds
This happens because of two separate bugs:
- The action validation failed to verify the data type of the argument
- When adding the fallback keybinds we add them as string but expect them being an int

This commit fixes the first bug.

Fixes 1ee8715d57
actions: use enum for _ToEdge actions
2023-08-06 10:37:36 +02:00
Johan Malm
2c14a5a406 view: make move_sub_views() use append_children method
...to share common code with minimize_sub_views()

Also, fix a bug in the move-to-back functions to move the window
hierarchy in the right order.

Helped-by: @Consolatis
2023-08-05 21:06:28 +02:00
Johan Malm
e991eae103 view: minimize parents/children together
Minimize the whole view-hierarchy from top to bottom regardless of which
one in the hierarchy requested the minimize. For example, if an 'About' or
'Open File' dialog is minimized, its toplevel is minimized also, and vice
versa.

For reference:
- This is consistent with in openbox, where child views (dialogs) can be
  minimized, but when doing so the parent is also minimized.
- In mutter these types of dialogs cannot be minimized (via client-menu or
  otherwise).
- In both openbox and mutter, when a toplevel window is minimized any open
  children are also minimized.
2023-08-05 15:25:00 +01:00
Johan Malm
d961dbf9b0 xwayland: fix client request-unmap bug
Remove foreign-toplevel handle when a client sends a request-unmap to a
minimized (therefore unmapped) view.
2023-08-05 15:25:00 +01:00
Johan Malm
dfc0dfba6d xwayland: guard against mapping view without surface
...which may occur if a user minimizes an xwayland view (typically a
child view such as a dialog) at the same time as the client sends a
request-unmap, which xwayland clients sometimes do without actually
requesting destroy and just leave them dangling.
2023-08-05 15:25:00 +01:00
Johan Malm
1212f34825 view: move (z-order) ancestors with modal dialogs
...so that other window cannot be positioned between modal dialogs and
their parent windows. This is consistent with Gtk3 and Qt5 applications on
mutter and openbox.
2023-08-05 15:25:00 +01:00
Johan Malm
e1743e1de2 xdg: show modal dialog above parent window
This behaviour is consistent with that of mutter and openbox.

Fixes: issue #823
2023-08-05 15:25:00 +01:00
Johan Malm
17c6af8925 labwc-theme(5): describe color alpha value
...which has been supported for a long time but not been reflected in the
man page.  Colors can be parsed as `#rrggbb aaa` with aaa representing a
decimal alpha value. This could be used to hide a button, for example:

    window.active.button.menu.unpressed.image.color: #000000 0
    window.inactive.button.menu.unpressed.image.color: #000000 0
2023-08-05 04:13:25 +02:00
Consolatis
1ee8715d57 actions: use enum for _ToEdge actions
This also improves the config robustness as invalid edge names will now
prevent the action to be created in the first place and the user gets
notified about the issue.
2023-08-02 17:57:04 +01:00
Ph42oN
cb4afadd01 view: move MoveRelative code from action.c and restore natural geometry 2023-07-24 00:55:08 +02:00
Johan Malm
c6e2f667d3 keyboard: fallback on raw keysyms for bindings
When looking up keybinds, if the translated keysyms (based on the keymap
for the keyboard) do not match a defined keybind, try raw keysyms (as if
there were no modifier translation).

This allows a user to define for example keybind with "S-1" rather than
"S-exclam". It also supports "W-S-Tab".

Fixes: issues #163 #365 #992
2023-07-18 19:29:21 +01:00
Johan Malm
8686023b0f keyboard: combine nsyms and *syms in struct
...in preparation for handling raw keysyms

No functional change intended.
2023-07-18 19:29:21 +01:00
Johan Malm
aef5b45b5f theme: limit corner radius to the height of the titlebar 2023-07-17 20:12:14 +01:00
Johan Malm
318d881650 theme: fix rounded-corner bug
Make top left/right corner pieces with large border thickness pixel
perfect.

Fixes: issue #988
2023-07-17 20:12:14 +01:00
John Lindgren
b816c16701 Chase wlroots: Stop using wlr_xwayland_surface event data
Chases: 27edd024f83892f4af9c5084d47b73f26966aaf1
xwayland: pass NULL as event data
2023-07-17 08:35:46 -04:00
John Lindgren
216056a653 Chase wlroots: Add missing #include
Chases: 323f0b94db22877487bca073fca497cd033719e8
wlr_scene: Cleanup header includes
2023-07-17 08:35:46 -04:00
John Lindgren
423b569fdd xwayland: Fix segfault at exit (seen with wlroots master) 2023-07-17 10:22:28 +02:00
stefonarch
0eab7e082c Added missing closing tags 2023-07-16 11:26:23 +01:00
Johan Malm
6b83db34af build: bump version to 0.6.4 2023-07-14 20:44:38 +01:00
Johan Malm
c073c0e637 NEWS.md: add notes on 0.6.4 2023-07-14 20:41:42 +01:00
Johan Malm
598044aa6b dnd: fix focus at end of dnd operation
By default, leave keyboard-focus with the surface that originally had it
at the end of a dnd operation.  This is consistent with the default
behaviour of openbox and mutter.

If the 'focus/followMouse' option is enabled, then focus on the surface
under the cursor at the end of the dnd operation.

Fixes: issue #976
2023-07-10 17:17:59 +01:00
Consolatis
40aba9e542 Add support for ext_idle_notify_v1..
..and combine both idle variants into a standalone manager
2023-07-09 08:26:33 +01:00
Johan Malm
e06a8cfc7a find-banned: support reading multiple files from stdin 2023-07-06 18:04:55 +01:00
Johan Malm
684731200f find-banned: print filename with each unwanted token 2023-07-06 18:04:55 +01:00
Consolatis
309843c9c6 scripts/helper/find-idents.c: handle single line comment tokens 2023-07-06 18:04:55 +01:00
Johan Malm
29031a4c85 Add scripts/find-banned.sh 2023-07-06 18:04:55 +01:00
Consolatis
235a8ad9bc ToggleKeybinds per window 2023-07-06 06:02:28 +01:00
Johan Malm
b6dfffc782 osd: move get_osd_height() closer to where it is called from 2023-07-05 21:31:30 +01:00
Johan Malm
2c66fa279f osd: make item-border part of item-height 2023-07-05 21:31:30 +01:00
Consolatis
660127acb0 theme: add option osd.window-switcher.item.active.border.width
...and change default values for the variables below to keep the
window-switcher look the same as it was at the last release.

osd.window-switcher.padding = 4
osd.window-switcher.item.padding.y = 1
osd.window-switcher.item.active.border.width = 2
2023-07-05 21:31:30 +01:00
Johan Malm
55bf79c3fe theme: add option osd.window-switcher.padding
Fixes: issue #969
2023-07-05 21:31:30 +01:00
Consolatis
fe8cdd7f8b src/action.c: relax argument checks when running actions 2023-07-05 22:20:18 +02:00
Consolatis
65b441a0ba config: validate keybind, mousebind and menu actions 2023-07-05 22:20:18 +02:00
Consolatis
665d31c1c7 src/action.c: add action_is_valid() 2023-07-05 22:20:18 +02:00
Consolatis
b05b92bb27 src/action.c: enforce action arg->key being set 2023-07-05 22:20:18 +02:00
Johan Malm
d0b52139ed action.c: remove duplicate code 2023-07-04 06:01:47 +01:00
Johan Malm
49dfba1507 menu: support CDATA for <command> element
...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue #972
2023-07-04 06:01:47 +01:00
Johan Malm
2bbeea0fc2 checkpatch.pl: allow xmlFree in CamelCase format
...to avoid 'Avoid CamelCase' warning.
2023-07-04 06:01:47 +01:00
Johan Malm
0958e88c75 checkpatch.pl: remove 'spaces preferred around that...' warning
...because it gives a false positive for "xmlChar *foo" saying it should
be "xmlChar * foo".
2023-07-04 06:01:47 +01:00
Johan Malm
4a31972b6f menu: print menu.xml nodenames
...when LABWC_DEBUG_MENU_NODENAMES is set
2023-07-04 06:01:47 +01:00