When an X11 client clears override-redirect on a window (i.e. it
becomes "managed") without an unmap/map cycle, wlroots doesn't
re-emit the set_title/class/icon events. We need to synthesize
them to re-read the values from the surface.
From what I can tell, only older/misbehaving X11 clients would
actually do this (toggle override-redirect without unmap/map), so
this is perhaps a bit pedantic, but an easy fix anyway.
Before this commit, ssd_update_title() returned early and the title was
not updated when the title gets empty. Furthermore, this caused the
title buffer to be misplaced outside of the titlebar when the window is
resized.
Reproducer:
1. Build and launch https://github.com/tokyo4j/wayland-demo/tree/repro-labwc-ssd-title-not-updated
2. One second later, the window title gets empty. But the title in
SSD is not updated.
3. Un-minimize the window. Now the title buffer is misplaced outside of
the titlebar.
- To reset the mode request we were using wlr_output_state_set_mode(NULL) which is not
allowed in wlroots. Replace it with removing the mode from the commit manually.
- Before this patch, we would assume that we can't configure an output if it doesn't have
any fixed mode. This is not true for wayland backed nested outputs. Replace the fixed
return false with wlr_output_test_state().
- Prevent configuring the output if the test fails as the current behavior was a
workaround for the hardcoded return false in case there were no fixed modes available.
Fixes: #3428
Reported-By: kode54
When running on the X11 or Wayland backend, each output corresponds
to a window in the parent compositor. Unlike DRM outputs, these
cannot be reconnected after being destroyed.
Terminate the compositor when the last output is destroyed on these
nested backends, matching the expected behavior when the user closes
the window.
Fix a regression introduced in 3f223fe5 where output layout changes may
move xdg views outside of the output layout with the error:
`view has no last placement info`. This happens also for X11 views if
they don't specify its own geometry on map.
Recent changes introduced `view->last_placement` which is used to
restore view positions after layout changes. This is supposed to be
updated when a view is mapped or manually moved by the user.
However, 3f223fe5 replaced `view_place_by_policy()` with
`view_compute_position_by_policy()` in the xdg view map handler. Unlike
`view_place_by_policy()`, this function does not update
`view->last_placement`, leaving it unset at the time of output layout
changes.
Therefore, this patch adds explicit calls to `view_save_last_placement()`
in the map handler to ensure `view->last_placement` is always set for
mapped views.
It was written that mouse cursor size can be set with XCURSOR_SIZE.
However, XCURSOR_THEME is also required, which exists in the context
of XCURSOR_PATH. Break them down in the ENVIRONMENT VARIABLES section.
Reported by: Consolatis (PATH)
Reported by: Jan Beich <jbeich@FreeBSD.org> (THEME)
Reported by: Thomas Dickey <dickey@invisible-island.net> (SIZE)
The previous commit desynchronized the action type arrays
causing Move operations to be treated as Raise actions.
Fixes: #3398
Reported-By: Domo via IRC
- Add `server` argument to `interactive_set_grab_context()` to clarify
it updates something in `server`.
- Add `const` qualifier to `ctx` argument of
`interactive_set_grab_context()` and `cursor_get_resize_edges()`
4f8b80700e added a check for the output
being enabled when creating a layershell surface with automatic output
selection. This causes labwc to send a `layer_surface.close()` and
`wl_surface.destroy()` to layershell clients when creating a new
layershell surface on a disabled output which is still part of the layout
(e.g. `wlopm --off`).
This MR replaces the `output_is_usable()` check with a dedicated check,
bypassing the check for the output being enabled.
Fixes: #3410
Reported-By: coruja
Allows slow clients to better deal with large amounts of events
coming in from labwc like from high refresh rate mice. Without
this patch, the client is likely to get disconnected because the
labwc side client write buffer is full.
Ensure that pointer focus is restored to the surface below when a layer
surface or popup is unmapped. Can be tested like below:
1. Open a terminal and move the cursor over it so it becomes an I-beam
2. Open a launcher (e.g. fuzzel) so the cursor becomes an arrow
3. Close the launcher
4. The cursor should become an I-beam again
Note: this commit restores `cursor_update_focus()` in
`handle_popup_destroy()` which was removed in bdbb1be3. I don't remember
why it was removed.
When a opening a layer-shell popup via IPC (like `lxVqt-qdbus openmenu` or
`xfce4-popup-applicationsmenu`), give keyboard focus to the popup, not the
parent layer-shell surface.
Written-by: @tokyo4j
...in support of enabling panel menus to be opened by keyboard shortcuts
and get keyboard focus so that they can be operated with the keyboard.
An example use-case is the xfce4-panel applications-menu being opened by
the command xfce4-popup-applicationmenu.
Works around `initialization discards ‘const’ qualifier from pointer target type`
Already fixed in wlroots master and 0.19.3 but that one has not yet been merged.
Soften the new rule introduced by 155c153 because it broke lxqt-runner
which defaults to the top-layer, and we do not want to knowingly break
user-space without a very good reason which we do not have for this.
Fixes: #3381
When switching between workspaces, we need to migrate omnipresent views
to the new workspace so that they are kept visible.
However, by using for_each_view_reverse() macro, we were not migrating
omnipresent views that view_is_focusable() return false (e.g. Conky).
Use wl_list_for_each_reverse() macro instead to catch all the
omnipresent views.
Before this commit, always-on-{top,bottom} windows were always visible
on all workspaces (omnipresent) because the they were not in
per-workspace trees like normal windows.
This commit fixes this by introducing per-layer trees in
`struct workspace`.
I also added `enum view_layer` and `view->layer` for simplicity.
...so that clients with on-demand keyboard interactivity in the
background/bottom/top layers do not steal focus. The reason for this is to
avoid desktop components like panels and desktops from stealing keyboard
focus if they are re-started.
We still let such clients in the overlay layer get focus on map so that
for example labnag with its default <prompt> setting take keyboard focus
on map, whilst still letting users click on something else to move focus
away.
Fixes: #3167
Add interactive_set_grab_context() which is called when the mouse button
is first pressed, before interactive_begin(). This fixes two small issues:
- The cursor origin position for interactive move/resize was slightly
off (depending on mouse resolution), because it was set after the
mouse had already moved slightly. Now it's exact.
- If app- or keybind-initiated maximize (etc.) happened after the button
press but before the mouse was moved, then interactive_begin() would
still start move/resize even though the view might now be far away
from the cursor. Now interactive_cancel() works as expected, even if
called before interactive_begin().
Also, make sure to call interactive_cancel() for un-maximize as well.