clapper-gtk: av: Fix checks when inhibiting session

This commit is contained in:
Rafał Dzięgiel
2025-12-08 20:00:42 +01:00
parent 065b8698dc
commit cbbd93bf04

View File

@@ -327,7 +327,7 @@ _set_inhibit_session (ClapperGtkAv *self, gboolean inhibit)
root = gtk_widget_get_root (GTK_WIDGET (self));
if (!root && !GTK_IS_WINDOW (root)) {
if (!root || !GTK_IS_WINDOW (root)) {
GST_WARNING_OBJECT (self, "Cannot %sinhibit session "
"without root window", (inhibit) ? "" : "un");
return;
@@ -337,7 +337,7 @@ _set_inhibit_session (ClapperGtkAv *self, gboolean inhibit)
* as it goes away early when unrooting */
app = g_application_get_default ();
if (!app && !GTK_IS_APPLICATION (app)) {
if (!app || !GTK_IS_APPLICATION (app)) {
GST_WARNING_OBJECT (self, "Cannot %sinhibit session "
"without window application set", (inhibit) ? "" : "un");
return;