diff options
author | lukefromdc <[email protected]> | 2025-02-25 14:53:11 -0500 |
---|---|---|
committer | Luke from DC <[email protected]> | 2025-03-31 04:38:46 +0000 |
commit | b2bdf46db90e334a020d56a4a9fcd653fddffe82 (patch) | |
tree | f06e20009ae610924aee351bb3229bb5c47b9d8d /shell/ev-application.c | |
parent | 160ae5025c4802391386170582b48641a9c1a0a0 (diff) | |
download | atril-b2bdf46db90e334a020d56a4a9fcd653fddffe82.tar.bz2 atril-b2bdf46db90e334a020d56a4a9fcd653fddffe82.tar.xz |
Wayland: stop segfaults on some systems
*Put a missed instance of gdk_x11_screen_get_screen_number behind x11-only selectors
Diffstat (limited to 'shell/ev-application.c')
-rw-r--r-- | shell/ev-application.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c index 56279aca..57f1b922 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -419,9 +419,17 @@ on_register_uri_cb (GObject *source_object, g_variant_builder_add (&builder, "{sv}", "display", g_variant_new_string (gdk_display_get_name (gdk_screen_get_display (data->screen)))); - g_variant_builder_add (&builder, "{sv}", - "screen", - g_variant_new_int32 (gdk_x11_screen_get_screen_number (data->screen))); + + if (GDK_IS_X11_SCREEN (data->screen)) { + g_variant_builder_add (&builder, "{sv}", + "screen", + g_variant_new_int32 (gdk_x11_screen_get_screen_number (data->screen))); + } else { + /*Do not crash on wayland, use the first monitor for now*/ + g_variant_builder_add (&builder, "{sv}", + "screen", + g_variant_new_int32 (0)); + } if (data->dest) { switch (ev_link_dest_get_dest_type (data->dest)) { case EV_LINK_DEST_TYPE_PAGE_LABEL: |