gdksurface-wayland: Fix contradictory assert

gdk_wayland_toplevel_inhibit_idle() contained a contradictory assert
that always fail. More specifically, in the branch that is supposed to
create the idle inhibitor, there is an assertion that it must already
exist and that the refcount must be greater than zero. This causes a
crash on WMs/DEs that use the ZWP idle inhibit manager protocol such as
KDE Plasma and Sway. Fix this by just asserting that the refcount is
zero instead.
This commit is contained in:
Kritphong Mongkhonvanit 2022-01-17 01:33:46 -05:00
parent 3bfaaab4f7
commit 55016ada92

View File

@ -2293,8 +2293,7 @@ gdk_wayland_toplevel_inhibit_idle (GdkToplevel *toplevel)
if (!wayland_toplevel->idle_inhibitor)
{
g_assert (wayland_toplevel->idle_inhibitor &&
wayland_toplevel->idle_inhibitor_refcount > 0);
g_assert (wayland_toplevel->idle_inhibitor_refcount == 0);
wayland_toplevel->idle_inhibitor =
zwp_idle_inhibit_manager_v1_create_inhibitor (display_wayland->idle_inhibit_manager,