I was making a theme and discovered only the active window button icon
color was taking effect. The pixmaps were being created in both the
active and inactive cases, but inactive pixmaps were never added to
the SSD scene graph.
IMHO it encourages better design (by making dependencies more obvious)
to have source file/header file pairs like view.c/view.h, rather than a
monolithic header like labwc.h with everything in it.
I don't think we need to break up all of labwc.h at once, but maybe we
can start pulling it apart bit by bit as it's convenient.
Also:
- Move "struct border" to ssd.h so that view.h can use it without pulling
in all of labwc.h.
- Add a missing required #include within scaled_font_buffer.h (forward
declaration of "struct font" is not enough).
Currently, snapping to a screen edge and then snapping to maximize
results in both the natural_geometry and tiled state of the view
getting messed up. After unmaximize, the view ends up in a weird
state (tiled location but natural/untiled size).
There are also a couple of sketchy things going on in the code:
- interactive_begin() pokes its own values into view->natural_geometry
to force view_maximize() to set a particular geometry.
- interactive_end() "fixes" view->natural_geometry after calling
view_maximize() to save the original geometry from the start of the
interactive move/resize.
To fix all this:
- Adjust/expand the API of view.c so that the interactive.c can
avoid this "back door" of overwriting view->natural_geometry
directly.
- Save the natural geometry and the tiled state of the view in
interactive_begin() when starting to move the view. When done,
interactive_end() will update the tiled state if appropriate but
*not* overwrite the natural geometry.
map() in xwayland.c called ssd_create() but did not call
view_apply_maximized_geometry() afterward, resulting in the
decorations being displayed off-screen.
Rather than calling view_apply_maximized_geometry() in more places,
let's reuse the existing call in view_set_decorations(), and extend
ssd_update_geometry() to call ssd_create() when needed.
Previously mosuebinds for the same context using the same button
but different modifiers would be merged, e.g. only the last one
would survive the merge. This commit adds the missing check for
keyboard modifiers.
Fixes#630
Reported-by: @lidgnulinux
This ensures that those surprised by the deprecation of SUID operation
receive an error rather than accidentally having run as root.
swaywm/sway@e572805
Mouse bindings, unlike key bindings, are made within contexts which
represent what was clicked/dragged. The context 'Frame' refers to the
entire window frame including both the window decorations (if any) and the
client window itself. It is typically used for alti + left/right click to
move/resize the window.
'Frame' is a special case in that when a button is bound in this
context, the action will not be forwarded to the client, which is what
we describe with the 'consumed_by_frame_context' variable.
Currently, the `rc.xml` parser applies font settings in a `<font>` tag with an
unknown value for its `place` attribute to all fonts. This means that whatever
the final unknown-`place` `<font>` tag is in a user's `rc.xml` applies to all
text drawn by labwc.
Instead, only treat `<font>` tags with an empty or missing `place` attribute as
applying globally, and warn when encountering unknown `place` attribute values
(which will help us find font places to support).
Each XWayland view is paired with a particular wlr_xwayland_surface and
its lifetime is tied to that surface. This condition in handle_map():
if (xsurface != view->xwayland_surface)
could never be true since the view is only registered to receive the
"map" signal from view->xwayland_surface, and no other. So the code
updating view->xwayland_surface in handle_map() was dead.
So let's clean things up a little:
- Remove the dead code
- Add some comments, and slightly rearrange code to match
- Add/update assert()s in signal handlers for consistency
- Pass xsurface as <data> when calling handle_unmap() and
handle_destroy() explicitly, to be consistent
It seems that every Wayland client is expected to implement its own
key-repeat logic, rather than doing it server-side as in X11. This
means that labwc also has to implement its own key-repeat logic for
compositor keybindings.
This is a very simplistic timer-based implementation. It doesn't
attempt to synthesize accurate timestamps, and may lag depending
on system load, but it appears to get the job done.
v2: Use server->wl_event_loop
v3: Comments and formatting
...in support to specifying 'left', 'right' and so on with actions
GoToDesktop and SendToDesktop.
For example:
<mouse>
<default/>
<context name="Desktop">
<mousebind button="Up" action="Scroll">
<action name="GoToDesktop" to="left"/>
</mousebind>
<mousebind button="Down" action="Scroll">
<action name="GoToDesktop" to="right"/>
</mousebind>
</context>
</mouse>
Since xwayland commit 9e4b7948df5a9a67632bb606150ec171b5519672
there is a one-second delay between XWayland surfaces being
unmapped and destroyed. This revealed that we were not actually
handling the unmap() signal correctly for unmanaged surfaces.
...to the pid of the compositor so that SIGHUP and SIGTERM can be sent to
specific instances using `kill -s <signal> <pid>` rather than
`killall -s <signal> labwc`
Issue #573
@Consolatis determined that apparently the extra "clear focus"
event confuses the drag source during drag-and-drop.
Fixes drag-and-drop of files into folders within the same Thunar
window.
...so that it can be determined what wlr_keyboard events come from.
This is required to manage virtual keyboards alongside the keyboard_group
of physical keyboards.
On initial positioning of toplevel windows we call view_center().
During the centering process, if it turns out that the view is larger than
the output usable-area then we just top/left align it with no gap.
Relates to the gap aspect of issue #403
Reported-by: @Flrian
Key events associated with keybindings (both pressed and released) are not
sent to clients. When using wlr_seat_keyboard_notify_enter() it it
therefore important not to send the keycodes of _all_ pressed keys, but
only those that were actually _sent_ to clients (that is, those that were
not bound).
This approach is consistent with sway's implementation in input/seat.c
cffb006feb/sway/input/seat.c (L173-L175)
Fixes issue #510
Call key_state_set_pressed() before checking
seat->active_client_while_inhibited to avoid missing release events for
clients using the inhibit protocol (for example swaylock).
If a user lets go of the modifier (e.g. alt) before the 'normal' key (e.g.
tab) when window-cycling, we do not end the cycling until both keys have
been released. If we end the window-cycling on release of the modifier
only, some XWayland clients such as hexchat realise that tab is pressed
(even though we did not forward the event) and because we absorb the
equivalent release event it gets stuck on repeat.
Just to clarify the position here: Issue #176 describes a behaviour
whereby dmenu gets stuck on repeat after being launched with a keybind.
This patch does not resolve that issue but reflects that in Wayland, the
client is responsible for implementing "key repeat".
Changing the key repeat rate/delay in (labwc/labwc@e62bb51) was dirty fix
that need should never have been made.
This fixes an issue with the wlr_output_cursor not being properly
initialized on new outputs, because wlr_output_layout.events.change
is triggered too soon, before the wlr_output_cursor exists.