Skip to content

Commit 91396c1

Browse files
dterraheTurboGit
authored andcommitted
simplify bauhaus wayland exception
1 parent 0ba4611 commit 91396c1

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/bauhaus/bauhaus.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -462,23 +462,18 @@ static void _window_moved_to_rect(GdkWindow *window,
462462
static void _window_position(const int offset)
463463
{
464464
dt_bauhaus_popup_t *pop = &darktable.bauhaus->popup;
465-
466-
if(pop->composited && gtk_widget_get_visible(pop->window))
467-
{
468-
pop->offcut += offset;
469-
return;
470-
}
471-
472465
int height = pop->position.height;
473-
pop->offset += offset;
474466

475-
pop->composited = FALSE;
476467
// On Xwayland gdk_screen_is_composited is TRUE but popups are opaque
477468
// So we need to explicitly test for pure wayland
478469
#ifdef GDK_WINDOWING_WAYLAND
479470
if(GDK_IS_WAYLAND_DISPLAY(gtk_widget_get_display(pop->window)))
480471
{
481-
pop->composited = TRUE;
472+
if(gtk_widget_get_visible(pop->window))
473+
{
474+
pop->offcut += offset;
475+
return;
476+
}
482477
gtk_widget_set_app_paintable(pop->window, TRUE);
483478
GdkScreen *screen = gtk_widget_get_screen(pop->window);
484479
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
@@ -488,6 +483,8 @@ static void _window_position(const int offset)
488483
}
489484
#endif
490485

486+
pop->offset += offset;
487+
491488
if(pop->offcut > 0)
492489
pop->offcut = MAX(0, pop->offcut + offset);
493490

src/bauhaus/bauhaus.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ typedef struct dt_bauhaus_popup_t
185185
GdkRectangle position;
186186
int offset;
187187
int offcut;
188-
gboolean composited;
189188
} dt_bauhaus_popup_t;
190189

191190
typedef struct dt_bauhaus_t

0 commit comments

Comments
 (0)