Change begin_destroy to remove event listeners before the final destroy,
since otherwise event listeners would be removed twice, which crashes.
This fixes a crash in wlroots listener checks. See #8509.
sway_input_method_relay can be destroyed from two sources, either the
seat is destroyed or the manager protocol objects are destroyed due
compositor exit. Therefore, finish must check whether it has already
been called.
This fixes a crash in wlroots listener checks. See #8509.
max_width was applied to the source box, but not to the cairo surface.
The cairo surface would therefore take on arbitrarily large dimensions
according to the required dimensions to fit the text input, which if
large enough would cause failures during output rendering and leave a
black hole in the titlebar.
Calling container_update() wasn't enough: If there is no visible window
decorations (title bar, borders) container_update would basically no-op
and the scene wouldn't repaint with the update alpha. By also calling
output_configure_scene() we force a call to
wlr_scene_buffer_set_opacity() thus ensuring we update the scene.
Closes: #8580
currently, the output background command handler prematurely
returns with an error if the background file cannot be accessed.
It should only error if user did not provide fallback color.
closes#8556
Changes
- Introduce variables to avoid uneccessary writing on output members
- Log a debug message when fallback is being used over inaccessible
file
- Always parse the background color and swaynag warn if it is incorrect
- when updating output member variables, free previous values
- add cleanup label and goto it if `strdup` fails
- Move output->member initializations to before parsing fallback, Also
free and init output->background as well
Increasing the max default buffer size prevents clients from crashing
when they need more than 4096 bytes. This can happen when the GUI thread
of the application is blocked, especially when moving your mouse over it
with high mouse sensitivity.
The background color can be set individually for the different
elements of the bar. If any of the backgrounds have transparency, we have
to bail out from advertising an opaque surface.
0d6cc471e9
added an assert that all signals are clear when destroying a
wlr_scene_buffer, which is currently triggering due to sway not removing
the output_enter and output_leave listeners on the container before
calling wlr_scene_node_destroy on output_handler. Remove the listeners
before wlr_scene_node_destroy is called.
The teardown of a sway_output is split in two: begin_destroy and
output_destroy. The former clears some state such as NULL'ing the
reference to wlr_output, while the latter frees the struct and its
remaining resources.
If an output is destroyed while a repaint timer is pending, future frame
callbacks will no longer occur as the listener is torn down in
begin_destroy, but the repaint timer is not torn down and may still
fire until output_destroy is hit. As begin_destroy cleared the reference
to wlr_output, this leads to a NULL-pointer dereference.
Tear down the repaint timer in begin_destroy as there is no need for it.
Fixes: fdc4318ac6 ("desktop/output: Clear frame_pending even output is disabled")
IPC clients generally expect executed commands to have taken effect when
the command completes, while delayed modeset means that it can take
several milliseconds more before e.g. an output is enabled.
However, modesetting on every output command in the IPC call could on
systems with already slow modesetting behavior lead to an unresponsive
system for a not insignificant period of time.
To strike a balance, force modeset once all the commands of this IPC
call have executed if a modeset is pending.
Some commands require outputs to be enabled. These commands are deferred
to allow outputs to be discovered, but the delayed modeset might only
run some time later.
Force a modeset to occur before running deferred commands.
Fixes: https://github.com/swaywm/sway/issues/8433
Emit property change signals for the IsStatusNotifierHostRegistered and
RegisteredStatusNotifierItems properties in StatusNotifierWatcher,
so code relying on the PropertiesChanged signal, instead of signals
such as StatusNotifierHostRegistered, can work properly.
A library that is affected by this is the libappindicator-gtk3* library
and it can cause tray icons to be missing after starting swaybar due to
a race condition, as follows:
* An application using libappindicator-gtk3 starts, e.g. nm-applet.
* Some time later, swaybar starts.
* swaybar creates the StatusNotifierWatcher.
* libappindicator-gtk3 observes the new watcher, but it sees that
IsStatusNotifierHostRegistered=false, so it falls back to the
Freedesktop System tray protocol.
* swaybar creates the StatusNotifierHost.
At this point, libappindicator-gtk3 should "un-fallback" back to SNI.
However, since swaybar does not emit the PropertiesChange signal on
IsStatusNotifierHostRegistered, libappindicator-gtk3 doesn't get
notified, and stays in fallback state forever.
* As a result, nm-applet will not show in the swaybar tray.
This race can be made reliable by inserting a 1-second long sleep here:
03483ff370/swaybar/tray/tray.c (L57)
(*) Note that the libappindicator-gtk3 library has been mostly replaced
by libayatana-appindicator, which is not affected by this.
The affected version is still used by Arch Linux, source code at:
https://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk/files/298
The modeset logic iterates over all outputs at the end, sets their new
position in the layout and takes a copy of its geometry that is later
referenced by layout and scene management code.
If one output is auto configured, then a later output that is manually
configured can lead to the first output being moved without the stored
geometry being updated.
Split this into two passes: The first pass finalizes the output config
and makes updates to the layout, while the second pass updates the copy
of the geometry and arranges things as a result of it.