[gtk: 1/2] gdksurface-wayland: Fix contradictory assert




commit 55016ada9239a9413938cccafe145710ee38f3c4
Author: Kritphong Mongkhonvanit <kritphong mongkhonvanit tk>
Date:   Mon Jan 17 01:33:46 2022 -0500

    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.

 gdk/wayland/gdksurface-wayland.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 93498d7cb5..7476c6a445 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]