The view->impl functions do not directly support mapping a view while
minimized. Instead, mark it as not minimized, map it, and then minimize
it again.
Fixes: #2627
Fixes a regression in 75eb370 that emits errors like:
[../labwc/src/common/scaled-font-buffer.c:26] font_buffer_create() failed
...when osd_field_get_content() doesn't set non-null text.
There is no "labwc" manpage in section 5 (man 5 labwc may fail or
show e.g. labwc-action manpage).
Replaced one 'we' with passive form, to match the common style in docs/.
Workspace switcher boxes height was 2px more than supposed,
e.g. theme defaults of 20x20 resulted in 20x22 boxes.
The middle of the boxes list was also 1px to the left of the middle
of the osd window.
Before this commit, all <field> entries inside different <fields> entires
were inserted to the same list. Suppose we have following configuration:
<windowSwitcher>
<fields><field content="title" width="100%" /></fields>
</windowSwitcher>
<windowSwitcher>
<fields><field content="identifier" width="100%" /></fields>
</windowSwitcher>
In this case, both two <field> entries were inserted to
rc.window_switcher.fields, making the OSD content overflow.
This commit fixes by clearing rc.window_switcher.fields when the parser
encounters <windowSwitcher><fields>.
Before this commit, when we have multiple <theme><titlebar><layout>
entries like below, duplicated button types can be inserted to
rc.title_buttons_{left,right} and the button could go outside of the
window:
<theme>
<titlebar><layout>icon:iconify,max,close</layout></titlebar>
<titlebar><layout>icon:iconify,max,close</layout></titlebar>
</theme>
This commit fixes by clearing those lists when the parser encounters
<theme><titlebar><layout>.
The default window switcher layout is updated from:
<windowSwitcher>
<fields>
<field content="type" width="25%" />
<field content="trimmed_identifier" width="25%" />
<field content="title" width="50%" />
</fields>
</windowSwitcher>
to:
<windowSwitcher>
<fields>
<field content="icon" width="5%" />
<field content="desktop_entry_name" width="30%" />
<field content="title" width="65%" />
</fields>
</windowSwitcher>
Only desktop entry name and title are shown when libsfdo is not linked.
Before this patch, when followMouse and followMouseRequiresMovement are
both yes, we set the keyboard focus when the cursor moves within an
unfocused surface. However, kwin, xfwm4 and openbox all set keyboard focus
only when the cursor enters a surface.
This allows users to make the icon in window switcher bigger (or smaller)
than the font size, which enables more Openbox-like appearance.
Example configuration:
osd.window-switcher.item.icon.size: 50
This commit also makes the icon smaller than the font size if the width
allocated with <windowSwitcher><fields><field width=""> is smaller than
that.
Before this commit, when a normal window is raised, xwayland thought it's
above always-on-top (AOT) windows even though it's actually below AOT
windows in the scene. This means mouse scroll events may be unexpectedly
sent to normal windows below AOT windows even when the cursor is hovering
over a AOT window.
So this commit fixes it by notifying the correct stacking order (where AOT
windows are placed above normal windows) to xwayland every time the
stacking order is updated.
Other benefits of this commit are:
- It makes the code more readable and predictable by aggregating logic
about stacking order management in xwayland (e.g. shaded windows or
windows in other workspaces should be notified to xwayland as being
placed at the bottom).
- As server->last_raised_view is removed in the previous commit, we were
notifying the stacking order to xwayland every time a window with dialog
windows is clicked (not when clicking a topmost window without dialogs,
due to some optimization in wlroots). This commit fixes this by caching
the window stacking order in xwayland_view->stacking_order and notifying
it to xwayland only when it's updated.
We were skipping in view_move_to_front() if the raised view is already
cached as server->last_raised_view. But this was prone to bugs that
windows cannot be raised even though they are actually not placed at the
top in the scene.
This happened when a window is mapped but view_move_to_front() is not
called in view_impl_map() for some reason. Example cases were:
- a window is minimized before being mapped (#2627)
- a window is mapped while window switcher is active (#2629)
Also, this problem was the root cause of #1640 and #2582, though they are
already fixed.
Therefore, this commit removes server->last_raised_view. In order to
eliminate unnecessary communications between labwc and xwayland (ref:
db591d1), I'll introduce another caching mechanism in the next commit.
This may slightly degrade UX, but this prevents the temporary buffer from
being reallocated for every frame when the magnifier spans multiple
outputs with different scales/transforms.
Fixes
```
../src/magnifier.c:153:3: error: missing initializer for field ‘clip’ of ‘struct wlr_render_rect_options’ [-Werror=missing-field-initializers]
153 | };
| ^
In file included from ../subprojects/wlroots/include/wlr/render/wlr_renderer.h:14,
from ../subprojects/wlroots/include/wlr/types/wlr_output.h:17,
from ../src/magnifier.c:5:
../subprojects/wlroots/include/wlr/render/pass.h:115:27: note: ‘clip’ declared here
115 | const pixman_region32_t *clip
```
char **s not needed to get trailing whitespace trimmed,
and rtrim() does not return anything
if there is leading whitespace in *s in call to string_strip(),
there is less chars left to scan in rtrim().
This ensures all event listeners are removed before the emitting
wlroots object is being destroyed. This will be enforced with asserts
in wlroots 0.19 but there is no reason to not do it right now either.
This change in wlroots 0.19 is implemented via commit
8f56f7ca43257cc05c7c4eb57a0f541e05cf9a79
"Assert (almost all) signals have no attached listeners on destroy"
This removes the need to call update_client_list_combined_menu()
and update_client_send_to_menu() every time a root menu is opened.
This commit also fixed the incorrect menu position with following
configuration:
<menu id="foo" label="foo">
<item label="aaaaaa"/>
<item label="bbbbbb"/>
</menu>
<menu id="root-menu">
<menu id="foo" />
<menu id="foo" />
</menu>