Commit graph

1357 commits

Author SHA1 Message Date
Consolatis
c8ddb0143c
Merge pull request #540 from jlindgren90/cursor-fixes
cursor: Factor out cursor_update_common() and fix some glitches
2022-09-13 20:55:32 +02:00
John Lindgren
6c6e406507 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.
2022-09-13 13:29:36 -04:00
Johan Malm
4ba59f7074 rcxml.c: enable tap be default on non-touch devices
Some trackpads do not honour tap if we only enable it on touch-devices.
2022-09-11 21:26:32 +01:00
Consolatis
baf555edd0 cursor: Handle missing cursor theme
Temporary fix for #246

This should be reverted once wlroots MR !3651 is merged.
2022-09-11 21:20:00 +01:00
Consolatis
9b02021207 cursor: Don't load cursor theme in server_init()
We are already doing that in seat_init() -> cursor_init()
2022-09-11 21:20:00 +01:00
Consolatis
0deaeceb72 cursor: Prevent setting the same cursor image twice
Possibly fixes #512

Reported-by: @Flrian
2022-09-11 13:30:10 +01:00
Consolatis
7af74c88a8 cursor: Prevent resetting cursor icon during Move or Resize
Reported-by: @Flrian
2022-09-11 13:24:27 +01:00
Consolatis
c0f0e0c46e cursor: Allow re-enter for cursor_update_focus()
This allows forcing an application to re-set their desired cursor image.
2022-09-11 13:24:27 +01:00
Johan Malm
1483158b26
Merge pull request #531 from jlindgren90/titlebar-fixes
Titlebar fixes
2022-09-09 21:35:30 +01:00
John Lindgren
48fde32e62 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.
2022-09-09 15:23:13 -04:00
John Lindgren
ebd0a5d526 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.
2022-09-09 15:23:13 -04:00
Johan Malm
62e9bb7236
Merge pull request #523 from jlindgren90/unmanaged-cursor-focus
cursor: Update focus when unmanaged surfaces are mapped/unmapped
2022-09-09 15:48:14 +01:00
Johan Malm
f47de15f98
Merge pull request #526 from Consolatis/issue/317_gimp_remap
xwayland: Keep view->xwayland_surface and view->surface in sync
2022-09-09 15:32:14 +01:00
John Lindgren
d5e2728c7f interactive: Don't write to view->x/y/w/h directly
Otherwise, the scene-graph isn't updated when calling
view->impl->configure(), and the view ends up in a weird
half-maximized state.
2022-09-08 20:08:03 -04:00
Consolatis
2bbd882df9 cursor: Update cursor focus on scroll events 2022-09-08 01:32:22 +02:00
Consolatis
f057235a1f cursor: Make cursor_rebase() private
Also allow to re-use node, surface, sx and sy.
2022-09-08 01:32:22 +02:00
Consolatis
601a6250b7 cursor: Allow cursor button events to trigger cursor_rebase() 2022-09-08 01:32:22 +02:00
Consolatis
bc4ce1bd5d src/xdg.c: Only call view_moved() when required 2022-09-08 01:32:22 +02:00
John Lindgren
79d9cfcda6 desktop: Cycle first to topmost view if not already focused
The topmost view may not always be the focused view; for example,
when Audacious's main window is focused but the floating Search
Tool window remains on top of it.  In that case the floating window
(not the main window) should be the first view selected in the
window switcher.
2022-09-07 00:27:03 +02:00
John Lindgren
ec2522fec8 cursor: Update SSD hover state in cursor_rebase()
Fixes an issue where the maximize button would remain highlighted
after maximized a window.
2022-09-06 18:22:17 -04:00
John Lindgren
469adc46d6 cursor: Update focus at various additional points
- When XDG and XWayland views are positioned (view_moved()).
- When unmanaged XWayland surfaces are mapped, unmapped, or moved.

Do not update cursor focus during an out-of-surface drag.

Along with the existing call in desktop_move_to_front(), this
should hopefully cover the majority of cases where the cursor focus
could get out-of-date, with the possible exception of layer-shell
surfaces.
2022-09-06 18:22:17 -04:00
Consolatis
a0afd443f5 src/xwayland.c: Keep view->surface in sync 2022-09-06 22:03:17 +02:00
Consolatis
01e832b4a8 src/xwayland.c: Update xsurface on client map request 2022-09-06 22:03:17 +02:00
John Lindgren
2e81cc13d4 xwayland: Don't center views with explicitly specified position 2022-09-06 13:39:22 +02:00
John Lindgren
b8096b1bab view: Call view_moved() immediately after map
At least for XWayland surfaces, handle_commit() is not always
called after map(), and as a result, the scene-graph node is never
positioned.

Not sure 100% if the same can occur with XDG surfaces, but the
extra view_moved() call should be harmless, so add it there too
for consistency.
2022-09-06 13:39:22 +02:00
John Lindgren
05b7afd05a xwayland: Factor out focus_next_surface() from unmanaged_handle_unmap()
- Eliminate multiple "return" paths in unmanaged_handle_unmap(), which
  were a bug waiting to happen.
- Use wl_list_for_each_reverse() rather than wl_list_for_each() to find
  the topmost (most-recently-created) unmanaged surface.
- Only call desktop_focus_topmost_mapped_view() if the unmapped surface
  was actually focused.
2022-09-03 19:31:20 +02:00
Consolatis
d405a2b3c6 CI: Split jobs 2022-09-02 06:11:01 +02:00
Consolatis
7f42dc921c CI: Additionally build without xwayland 2022-09-02 06:11:01 +02:00
John Lindgren
7c6c018f43 cursor: Fix out-of-surface movement for unmanaged surfaces 2022-09-02 05:12:34 +02:00
John Lindgren
f7b1bc1de8 xwayland: Keep unmanaged surfaces stacked on top 2022-09-01 21:07:04 +02:00
Consolatis
9c271d792d src/xwayland-unmanaged.c: Give keyboard focus back to topmost mapped view
Previously, when unmapping and not finding another unmanaged surface
to give keyboard focus to we were not doing anything. With this patch
we will give focus to the topmost mapped view which is the same
behavior that also happens when an usual X11 surface unmaps.

This fixes dmenu when being exited with ESC.

Reported-by: @Flrian
2022-08-30 19:20:58 +01:00
Consolatis
ea6007d34c src/config/rcxml.c: Add support for <devault /> mousebinds
This loads default mousebinds and provides a way to keep config files
simpler whilst allowing user specific binds.

Note that if no rc.xml is found, or if no <mouse><mousebind> entries
exist, the same default mousebinds will be loaded even if the <devault />
element is not provided.

Example usage (with a slight spelling error):

  <mouse>
    <default />
    <context name="Root">
      <mousebind button="Right" action="Press">
        <action name="ShowMenu" menu="desktop-menu" />
      </mousebind>
    </context>
  </mouse>

Co-Authored-By: @johanmalm

Fixes #416
2022-08-30 16:39:09 +01:00
Consolatis
3afd666cc4 src/config/rcxml.c: Replace earlier mousebinds by later ones 2022-08-30 16:39:09 +01:00
Consolatis
99237cc232 src/config/mousebind.c: Fix mousebind ordering 2022-08-30 16:39:09 +01:00
Consolatis
7b995788ee src/config/rcxml.c: Merge default mousebinds 2022-08-30 16:39:09 +01:00
Consolatis
ce5e7e153c src/view.c: Fix minimizing the last window
Before this patch, minimizing the last un-minimized window would
not cause it to be set to inactive. This in turn would confuse panels
which depend on the 'active' flag to decide when to either activate or
minimize the clicked on window.

Reported-by: @Flrian
Predicted-by: @johanmalm
2022-08-30 10:44:01 +01:00
Johan Malm
adc1e0876d
Merge pull request #307 from Consolatis/feature/tab_preview
Feature/tab preview: restore functionality after the move to scene-graph
2022-08-28 22:20:53 +01:00
Consolatis
2550c984f8 Move OSD handler for view destruction to osd.c 2022-08-28 20:40:49 +02:00
Consolatis
ca3c83aafc src/osd.c: Integrate preview outline into OSD state 2022-08-28 20:40:44 +02:00
Consolatis
15a5b710db alt-tab preview: restore functionality after move to scene-graph 2022-08-28 20:40:36 +02:00
Consolatis
296e58079f Prepare OSD for reimplementation of the preview feature 2022-08-28 20:40:29 +02:00
Consolatis
a32e1ff8f9 Chase wlroots: Culling
To update the wlroots subproject use
meson subprojects update wlroots

Chases wlroots fa7d2cb8d60ed48c44c707106c03682056ddfaca
wlr_scene: Only consider visible parts of the node when culling background

Fixes #501
2022-08-27 16:12:14 +01:00
Johan Malm
8a7048fd78 osd: position preview border within SSD max extents
This makes the border visible when alt-tabbing maximized windows and
prevents it from rendering on other outputs or on top of exclusive
layer-surfaces such as panels.

Closes issue #496
2022-08-27 16:14:29 +02:00
John Lindgren
b7c4ba825a view/ssd: Refactor and fix visual indication for active windows
Partially fixes #494.

Co-Authored-by: Consolatis
2022-08-27 06:58:20 +01:00
Consolatis
127a9c7be4 src/{common/font,theme}.c: Switch to cairo helpers 2022-08-26 06:54:12 +01:00
Consolatis
36b2a93a69 Disconnect view from destroying output
Fixes #497

Reported-by @Flrian
2022-08-24 20:24:19 +01:00
Flrian
c1490b632d Add config option to disable preview outlines 2022-08-24 20:21:14 +01:00
John Lindgren
33bc37e7d0 keyboard: Hide Alt-Tab switcher when canceling via Escape 2022-08-21 21:47:45 +01:00
John Lindgren
0dba67a41d osd: Do not show window switcher on disabled outputs 2022-08-21 21:47:45 +01:00
Consolatis
b39020213a src/osd.c: Add preview outlines 2022-08-20 22:40:31 +01:00