mirror of
https://github.com/labwc/labwc.git
synced 2026-04-03 07:15:34 -04:00
config: only default to xwayland persistence on old wlroots versions
This is a compile-time check, so it will be too conservative if somebody updates wlroots after building labwc, but that is still better than the alternatives.
This commit is contained in:
parent
ea58ab0259
commit
df6081b52c
2 changed files with 24 additions and 14 deletions
|
|
@ -219,13 +219,12 @@ this is for compatibility with Openbox.
|
||||||
*<core><xwaylandPersistence>* [yes|no]
|
*<core><xwaylandPersistence>* [yes|no]
|
||||||
Keep XWayland alive even when no clients are connected, rather than
|
Keep XWayland alive even when no clients are connected, rather than
|
||||||
using a "lazy" policy that allows the server to launch on demand and die
|
using a "lazy" policy that allows the server to launch on demand and die
|
||||||
when it is no longer needed. Default is yes.
|
when it is no longer needed.
|
||||||
|
|
||||||
This is only temporarily defaulting to yes to avoid a bug that is
|
When labwc is compiled with wlroots 0.18.2 or later, the default is no.
|
||||||
present in wlroots <0.18.2 resulting in a compositor crash when
|
When labwc is compiled with wlroots < 0.18.2, the default is yes to
|
||||||
performing a drag-and-drop action at the same time as the XWayland
|
avoid a wlroots bug that can result in compositor crashes when
|
||||||
server is shutting down. This will be reverted to a default "no" when
|
performing drag-and-drop actions when the XWayland server is shut down.
|
||||||
wlroots-0.18.2 can be linked with.
|
|
||||||
|
|
||||||
Note: changing this setting requires a restart of labwc.
|
Note: changing this setting requires a restart of labwc.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
#include <wlr/util/box.h>
|
#include <wlr/util/box.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
|
#include <wlr/version.h>
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "common/dir.h"
|
#include "common/dir.h"
|
||||||
#include "common/list.h"
|
#include "common/list.h"
|
||||||
|
|
@ -36,6 +37,9 @@
|
||||||
#include "window-rules.h"
|
#include "window-rules.h"
|
||||||
#include "workspaces.h"
|
#include "workspaces.h"
|
||||||
|
|
||||||
|
#define LAB_WLR_VERSION_OLDER_THAN(major, minor, micro) \
|
||||||
|
(WLR_VERSION_NUM < (((major) << 16) | ((minor) << 8) | (micro)))
|
||||||
|
|
||||||
static bool in_regions;
|
static bool in_regions;
|
||||||
static bool in_usable_area_override;
|
static bool in_usable_area_override;
|
||||||
static bool in_keybind;
|
static bool in_keybind;
|
||||||
|
|
@ -1089,16 +1093,14 @@ entry(xmlNode *node, char *nodename, char *content)
|
||||||
} else if (!strcasecmp(nodename, "xwaylandPersistence.core")) {
|
} else if (!strcasecmp(nodename, "xwaylandPersistence.core")) {
|
||||||
set_bool(content, &rc.xwayland_persistence);
|
set_bool(content, &rc.xwayland_persistence);
|
||||||
|
|
||||||
/*
|
#if LAB_WLR_VERSION_OLDER_THAN(0, 18, 2)
|
||||||
* TODO: Temporary warning message. Revert when wlroots-0.18.2
|
|
||||||
* can be linked with.
|
|
||||||
*/
|
|
||||||
if (!rc.xwayland_persistence) {
|
if (!rc.xwayland_persistence) {
|
||||||
wlr_log(WLR_ERROR, "setting xwaylandPersistence to 'no' "
|
wlr_log(WLR_ERROR, "to avoid the risk of a fatal crash, "
|
||||||
"is not encouraged unless wlroots-0.18.2 is used "
|
"setting xwaylandPersistence to 'no' is only "
|
||||||
"since it has a potential risk of crashing the "
|
"recommended when labwc is compiled against "
|
||||||
"entire session. See #2371 for details.");
|
"wlroots >= 0.18.2. See #2371 for details.");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else if (!strcasecmp(nodename, "x.cascadeOffset.placement")) {
|
} else if (!strcasecmp(nodename, "x.cascadeOffset.placement")) {
|
||||||
rc.placement_cascade_offset_x = atoi(content);
|
rc.placement_cascade_offset_x = atoi(content);
|
||||||
} else if (!strcasecmp(nodename, "y.cascadeOffset.placement")) {
|
} else if (!strcasecmp(nodename, "y.cascadeOffset.placement")) {
|
||||||
|
|
@ -1463,7 +1465,16 @@ rcxml_init(void)
|
||||||
rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED;
|
rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED;
|
||||||
rc.allow_tearing = false;
|
rc.allow_tearing = false;
|
||||||
rc.reuse_output_mode = false;
|
rc.reuse_output_mode = false;
|
||||||
|
|
||||||
|
#if LAB_WLR_VERSION_OLDER_THAN(0, 18, 2)
|
||||||
|
/*
|
||||||
|
* For wlroots < 0.18.2, keep xwayland alive by default to work around
|
||||||
|
* a fatal crash when the X server is terminated during drag-and-drop.
|
||||||
|
*/
|
||||||
rc.xwayland_persistence = true;
|
rc.xwayland_persistence = true;
|
||||||
|
#else
|
||||||
|
rc.xwayland_persistence = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
init_font_defaults(&rc.font_activewindow);
|
init_font_defaults(&rc.font_activewindow);
|
||||||
init_font_defaults(&rc.font_inactivewindow);
|
init_font_defaults(&rc.font_inactivewindow);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue