Fixes the high CPU usage issue reported by @droc12345.
Changing `last_mag != is_magnify_on()` to `last_mag == is_magnify_on()`
works fine, but this check isn't needed in the first place because
magnifier state changes call `wlr_output_schedule_frame()`, which sets
`wlr_output->needs_frame`.
Also added a FIXME comment regarding the performance issue when the
magnifier is enabled.
We didn't support multiple IME popups since input-method-v2 protocol
has no way to position them individually, but we should support it to
provide IME developers with more programming flexibility.
We currently only support cursor emulation
for absolute motion, thus ignore tools/pens
that use relative motion.
Add a log statement on proximity-in to give
some feedback.
This mostly allows for using scripts that trigger a labwc SIGHUP
to work as expected. Before this patch, there was a race between
the event loop starting up and the autostart scripts executing.
One example of such a use-case is dynamically setting the keyboard
layout or cursor theme via environment variable based on feedback
from a dbus service like discussed in #1588.
This adds a screen magnifier which can be controlled with the
`ZoomIn` / `ZoomOut` and `ToggleMagnify` actions.
It scales up part of the rendered framebuffer so the magnification
may end up looking blurry depending on the magnification scale.
PR #1774
With commit cafdcd8e, the keyboard from the keyboard group is set to the
seat when the active keyboard is destroyed, but this broke `wtype`
against XWayland surfaces. This is likely because XWayland caches
keycodes from the compositor and convert them with the last keymap
received from the compositor. So when we run `wtype a` over a XWayland
surface, the keycode for `a` is cached by XWayland, the keymap from the
keyboard group is sent to XWayland, then Xwayland converts the keycode
using the keymap from the keyboard group, not the one `wtype` set.
This commit fixes this by setting the keyboard from the keyboard group
to the seat when the keyboard focus is moved to a surface, not when the
active keyboard is destroyed.
Before this commit, `top` layers were hidden whenever there is a
fullscreen window in the corresponding output.
With this commit, `top` layers are hidden only when there is a fullscreen
window without other windows above it in the corresponding output.
A caveat is that `bottom` layer is still always hidden by a fullscreen
window.
Chromium (and slurp) expect wl_keyboard.keymap event to be sent before
wl_keyboard.modifiers event. Normally, wl_keyboard.keymap event is sent
on the client first obtains wl_keyboard with wl_seat.get_keyboard
request.
However, after the active (especially virtual) keyboard is destroyed,
wlroots doesn't respond to wl_seat.get_keyboard request with
wl_keyboard.keymap event since there's no active keyboard on the seat.
Therefore, if we run commands like "sleep 2; wtype hello; chromium", the
active keyboard is destroyed when wtype finishes and
wl_keyboard.modifiers event is sent to Chromium when Chromium first maps
the surface and the keyboard focus is moved to it, then Chromium crashes.
With slurp, fcitx5 and multi-monitor setup, a similar thing happens.
When slurp first creates the layer-shell surfaces, the focus moves to it
(without wl_keyboard.enter though), and fcitx5 is transiently deactivated
and it destroys the virtual keyboard. Then when slurp maps those
surfaces, the focus moves between them again and wl_keyboard.modifiers
event is sent, thus slurp crashes.
So with this commit, when the active keyboard on the seat is destroyed,
the keyboard from the keyboard group is set to the seat instead so
wlroots can respond to wl_seat.get_keyboard request with
wl_keyboard.keymap.
This gives instant feedback when changing cursor theme or size.
It only works for server side cursors or clients using the
cursor-shape protocol.
Fixes: #1619
Addresses UX degradation introduced by commit 1d3ed457.
This prevents clicks with small movement with the intention of opening
the menu from unexpectedly closing the menu or selecting a menu item.
Clients can ignore the requsted geometry and negative widths could be
passed to `wlr_scene_rect_set_size()` in `ssd_titlebar_update()` or in
`ssd_border_update()`.
In OpenBox, when cursor button is pressed to open menu, a subsequent
cursor button release can perform actions or close the menu.
This commit makes labwc follow that behavior.
Fixes: #1750
Add optional drop-shadows to windows using server-side decoration.
Shadows can be enabled/disabled rc.xml and their appearance configured
in themerc. The default is no shadows to preserve current behaviour.
The shadows are drawn in fixed corner and edge buffers shared between
all windows, the edges are scaled to size depending on the size of each
window. Two sets of buffers are used to give the different appearances
for active and inactive windows. I use separate corner/edge buffers for
a few reasons:
- It avoids needing to store a separate large shadow buffer per window
- It avoids needing to redraw the shadows when the window is being
resized
- Compositing the shadows onto the desktop should be faster as there are
overall fewer pixels to blend, and scaling up the edge buffers only
requires reading a tiny buffer which is then replicated.
Filled/outlined rectangles shown as snapping overlay are now enabled/disabled
independently with `snapping.overlay.[region|edge].bg.enabled` and
`snapping.overlay.[region|edge].border.enabled`.
To keep the default behavior, `*.bg.enabled` is yes and `*.border.enabled` is
no for hardware-based renderers, while `*.bg.enabled` is no and
`*.border.enabled` is yes for software-based (pixman) renderer.
Users can now use a filled rectangle as an overlay even with pixman renderer.
However, this may severely impact performance when used with translucent
`snapping.overlay.[region|edge].bg.color`.
This commit includes a refactor to use substruct `theme_snapping_overlay`
inside `theme` in order to pass it to `create_overlay_rect()` in a cleaner way.
Breaking changes is:
- `snapping.overlay.[region|edge].fill` is now removed.