Commit graph

994 commits

Author SHA1 Message Date
Consolatis
4a20d57b38 src/foreign.c: verify associated view is still valid
Closes #172
2021-12-28 10:14:55 -05:00
Consolatis
4b2a7a28c6 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
2021-12-28 10:14:40 -05:00
Johan Malm
310c36c86d 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);
      |                ^~~~~~~~~~~~~~~
2021-12-28 15:06:33 +00:00
Consolatis
09949e6faf 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.
2021-12-28 09:50:21 -05:00
John Lindgren
455d85e01c 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)
2021-12-27 15:37:26 +00:00
Johan Malm
34a12b3515 Fix coding style 2021-12-26 23:29:01 +00:00
Johan Malm
60149e4fa5 CONTRIBUTING.md: wrap commit messages at 74 characters 2021-12-26 23:14:21 +00:00
Johan Malm
41274db128 Delete .clang-format
The file is not accurate and clang-format cannot describe our coding
style
2021-12-26 23:10:39 +00:00
Johan Malm
837a7f3997 docs/rc.xml.all: update with default mouse-bindings 2021-12-26 23:02:07 +00:00
Johan Malm
be300764b5 build: use wlroots 0.15.0 2021-12-26 22:42:51 +00:00
Johan Malm
6651d45ed4 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
2021-12-26 22:09:41 +00:00
Johan Malm
8d070ab2f4 cursor: fix setting of resize_edges
Only calculate nearest `resize_edges` if not clear from the server-side
deco under the cursor.
2021-12-26 21:35:37 +00:00
bi4k8
6a190797b6 document mouse buttons and newly-supported mouse contexts 2021-12-26 21:31:11 +00:00
bi4k8
5bd4833b87 add mouse bindings for window edges to rc.xml.all 2021-12-26 21:31:11 +00:00
bi4k8
26d3d13a82 move edge resizing from hard-coded to configuration 2021-12-26 21:31:11 +00:00
bi4k8
5ee4baee7a implement corner/edge mouse contexts 2021-12-26 21:31:11 +00:00
John Lindgren
2ce961a0bd Check the return value of wlr_output_layout_get() for NULL
wlr_output_layout_get() seems to return NULL for disabled outputs.

Fixes: #174
2021-12-24 21:08:32 +00:00
John Lindgren
46bd0d549f Proofread README.md
I couldn't help but notice some typos in README.md, and figured I might
as well fix them.

Spelling:

    simplicy -> simplicity
    inteded -> intended
    if -> is

Compound words:

    light-weight -> lightweight
    wall-paper -> wallpaper
    re-inventing -> reinventing
    re-loaded -> reloaded

Grammar/usage:

    & -> and
    binds -> bindings
    missing "the"
2021-12-24 20:08:14 +00:00
ARDiDo
fd09e26ac8 view.c: end interactive mode when maximizing a view 2021-12-23 12:22:46 -05:00
Consolatis
416718c3e9 docs/rc.xml.all: Add focus + raise to TitleBar movement / maximize 2021-12-23 10:42:22 -05:00
Consolatis
fa18f347e5 config/rcxml: Allow multiple <action>s inside of a <mousebind>
Issue arises when using the default config from docs/rc.xml.all.
Without this patch only the last action defined inside a <mousebind>
will have an effect.

Without a config or when defining the same <mousebind> multiple times
with each containing only a single <action> the issue does not exist.
2021-12-23 09:53:11 -05:00
Consolatis
80f012602f Implement foreign toplevel close 2021-12-23 09:29:08 -05:00
Johan Malm
7e57b7fcf5 keyboard: absolve release event if press was bound
When key press events are handled by compositor keybindings, do not
forward the corresponding release events to clients.
2021-12-22 10:37:25 -05:00
ARDiDo
57cc72b49e OSD: fix stuck OSD when NumLock or CapsLock are activated 2021-12-18 10:33:56 -05:00
ARDiDo
64cc0b91e8 build: bump wlroots dependency version number 2021-12-17 10:32:43 -05:00
ARDiDo
7d68eeb5eb cursor: scale xcursor for all output scales 2021-12-17 10:20:57 -05:00
bi4k8
4ce96f75dc osd: fix crash when props are NULL
this happened while running Xwayland *over* waypipe, so is likely not a common case, but is possible
2021-12-16 20:42:07 -05:00
bi4k8
fd7f06a375 document Focus and Raise actions 2021-12-12 19:07:08 -05:00
bi4k8
073c78551f document Client/Frame/Desktop mouse contexts 2021-12-12 19:05:01 -05:00
bi4k8
114e6545d6 document Resize action 2021-12-12 19:05:01 -05:00
bi4k8
3a29e436e5 fix crash when a minimized window closes
e.g., open an editor from a terminal, minimize it, then hit ^C in the terminal

simply don't unmap xdg or xwayland views if they are not currently marked as mapped
2021-12-12 19:03:03 -05:00
bi4k8
730a642bea document tapButtonMap setting 2021-12-12 19:00:58 -05:00
bi4k8
a3796fa6f3 implement libinput tapButtonMap setting
this is a standard libinput setting that was not previously exposed
2021-12-12 19:00:58 -05:00
ARDiDo
859495a8be Config: add OSD font configuration 2021-12-06 17:44:28 -05:00
Johan Malm
238062a859 desktop: rename functions to increase consistency
...from
- desktop_raise_view()
- desktop_move_view_to_end_of_cycle()

to
- desktop_move_to_front()
- desktop_move_to_back()
2021-12-06 21:23:49 +00:00
Johan Malm
9b99ff9042 labwc-action(5): add PreviousWindow 2021-12-06 21:13:21 +00:00
Johan Malm
10884ca2e9 desktop: simplify desktop_move_view_to_end_of_cycle() 2021-12-06 21:07:08 +00:00
bi4k8
bb4c277e08 query passed prop, not 'title' 2021-12-06 15:22:17 -05:00
bi4k8
7b7178ebfa move windows to back of cycle when they are minimized 2021-12-06 09:59:06 -05:00
bi4k8
b7d4df28c8 implement PreviousWindow action 2021-12-06 09:59:06 -05:00
bi4k8
83f876586a raise activated foreign windows
this is required for taskbars to behave as expected
2021-12-06 09:51:45 -05:00
ARDiDo
4bc012bf29 Fix typo in README 2021-12-05 10:13:34 -05:00
John Lindgren
5da0ebda5a keyboard: Remove redundant damage_all_outputs() call
It was already called earlier in handle_compositor_keybindings().
2021-12-04 12:24:47 -05:00
John Lindgren
b72d524c50 keyboard: Allow canceling the Alt-Tab switcher with Escape
This is a standard feature in most window managers (OpenBox
included) that allow window-switching via Alt-Tab.
2021-12-04 12:24:47 -05:00
John Lindgren
dddc4f5ed8 action: Switch to next window when pressing Alt-Tab once
In OpenBox (as in most other stacking window managers), pressing
Alt-Tab once will cycle to the next window.  This is especially
convenient in workflows which require switching back and forth
frequently between the two top windows.
2021-12-04 12:24:47 -05:00
Johan Malm
2cb055b94a cursor.c: fix switch statement indentation 2021-12-03 23:17:12 +00:00
Johan Malm
c5658fde8e interactive.c: fix style 2021-12-03 23:15:28 +00:00
Johan Malm
a60b88c7fa CONTRIBUTING.md: add link to checkpatch.pl 2021-12-03 23:14:52 +00:00
Johan Malm
fbf531b810 Add CONTRIBUTING.md 2021-12-03 22:44:06 +00:00
Johan Malm
d4a99d8e91 docs/rc.xml.all: add Client and Root mousebinds 2021-12-03 22:14:37 +00:00