Commit graph

1340 commits

Author SHA1 Message Date
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
Consolatis
fb36463c34 common/graphic-helpers: Add cairo helpers 2022-08-20 22:16:52 +01:00
Consolatis
8c8583ef94 common/graphic-helpers: Add multi_rect 2022-08-20 22:16:52 +01:00
Johan Malm
b5a0d74888 labwc-theme(5): add menu.xbm 2022-08-20 00:11:15 +02:00
Johan Malm
52d1e32b59 view: view_move() s/double/int/ for x and y 2022-08-18 19:50:25 +01:00
yizixiao
46fb3c3dec func output_destroy_notify add free 2022-08-17 14:09:36 +02:00
Johan Malm
0b0e438adb src/cursor.c: refactor nested if-statements 2022-08-17 14:03:38 +02:00
Johan Malm
f19645aa25 cursor: do not clamp motion coordinates for xdg-shell surfaces
...when pointer moves off the xdg-shell surface which is possible when
for example grabbing a scroll-bar or selecting text.

Clamping results in undetected pointer motion when applied in the
direction of movement (for example clamping at view->y masks vertical
movement when the y-coordinate is greater than view->y), which in turn
can appear as sporadic to the end-user.
2022-08-17 14:03:38 +02:00
Consolatis
921c877f79 src/cursor.c: Keep sending motion events for out-of-layer-surface
Previously, motion events for a cursor which had been pressed on a surface
and then moved out of the surface were only sent for XDG and X11 surfaces.

This patch includes layer surfaces as well.

Fixes #483
2022-08-16 19:31:16 +01:00
John Lindgren
8e6d37772e cursor: Do not clamp motion coordinates for XWayland surfaces.
X11 apps expect to be able to receive motion events outside
the window area (this is necessary for client-side move/resize
handles to work properly).  So do not clamp the motion
coordinates for XWayland surfaces.

Before this change, attempting to enlarge an XWayland window
using a client-side resize handle resulted in the window size
lagging behind the mouse cursor quite severely, since each
motion event was in effect allowed to expand the window by
only a few pixels.  The closer the initial button-press was
to the edge of the window, the worse the lag would be.
2022-08-16 19:31:16 +01:00
Johan Malm
19dea7450b keybind: remove default alt-escape for Exit
...because too many have exited the compositor by mistake trying to get
out of alt-tab cycling or similar.
2022-08-12 22:50:56 +02:00
Consolatis
1cdebbc22d src/ssd/ssd_titlebar.c: Completely hide title when running out of space
Before this commit the window title could overflow in certain conditions,
usually when rapidly resizing. This commit fixes it by completely hiding
the corresponding scene node when there is no space available.

Reported-by: <peperino> via IRC
2022-08-12 14:56:51 +01:00
Johan Malm
a610aff946 scaled_font_buffer.c: simplify calls to zfree()
There is no need to check foo != NULL before zfree(foo)
2022-08-12 11:16:17 +02:00
Johan Malm
429df42a8f menu: render submenu arrows 2022-08-12 11:16:17 +02:00
Johan Malm
6a750d465e font: remove unused font_buffer_update() 2022-08-12 11:16:17 +02:00
Johan Malm
70421b1207 menu: do not require label attribute for highest level menu definition
Allow highest level menu definitions - typically used for root-menu and
client-menu - to be defined like this:

    <openbox_menu>
      <menu id="">
      </menu>
    </openbox>

Previously this required a label attribute (which was not used for
anything and could be an empty string) as show below:

    <openbox_menu>
      <menu id="" label="">
      </menu>
    </openbox>

Closes issue #472
2022-08-11 20:59:57 +01:00
Consolatis
ac5c9dae00 src/xwayland-unmanaged.c: Prevent racing configure event to reposition
Fixes #469

Reported-by: @Flrian
Suggested-by: @jlindgren90
2022-08-11 16:19:00 +01:00
01micko
32b176e05e README.md: fix broken link for 'environment' man page
- re: https://github.com/labwc/labwc.github.io/pull/1
2022-08-01 18:57:12 +01:00