Skip to content

Commit a6c807b

Browse files
committed
Wayland: Remove splash screen if HAVE_LIBDECOR_H to fix fullscreen on Auto monitor index
1 parent d11766a commit a6c807b

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

gfx/common/wayland_common.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ bool gfx_ctx_wl_init_common(
912912
wl_display_roundtrip(wl->input.dpy);
913913
xdg_wm_base_add_listener(wl->xdg_shell, &xdg_shell_listener, NULL);
914914

915+
#ifndef HAVE_LIBDECOR_H
915916
/* Bind SHM based wl_buffer to wl_surface until the vulkan surface is ready.
916917
* This shows the window which assigns us a display (wl_output)
917918
* which is useful for HiDPI and auto selecting a display for fullscreen. */
@@ -921,23 +922,12 @@ bool gfx_ctx_wl_init_common(
921922
RARCH_ERR("[Wayland] Failed to draw splash screen.\n");
922923

923924
/* Make sure splash screen is on screen and sized */
924-
#ifdef HAVE_LIBDECOR_H
925-
if (wl->libdecor)
926-
{
927-
wl->configured = true;
928-
while (wl->configured)
929-
if (wl->libdecor_dispatch(wl->libdecor_context, 0) < 0)
930-
RARCH_ERR("[Wayland] libdecor failed to dispatch.\n");
931-
}
932-
else
925+
wl->configured = true;
926+
927+
while (wl->configured)
928+
wl_display_dispatch(wl->input.dpy);
929+
}
933930
#endif
934-
{
935-
wl->configured = true;
936-
937-
while (wl->configured)
938-
wl_display_dispatch(wl->input.dpy);
939-
}
940-
}
941931

942932
// Ignore configure events until splash screen has been replaced
943933
wl->ignore_configuration = true;
@@ -1018,12 +1008,19 @@ bool gfx_ctx_wl_set_video_mode_common_fullscreen(gfx_ctx_wayland_data_t *wl,
10181008
struct wl_output *output = NULL;
10191009
int output_i = 0;
10201010

1011+
#ifdef HAVE_LIBDECOR_H
1012+
if (video_monitor_index <= 0)
1013+
{
1014+
RARCH_LOG("[Wayland] Auto fullscreen monitor index, letting compositor decide.\n");
1015+
}
1016+
#else
10211017
if (video_monitor_index <= 0 && wl->current_output != NULL)
10221018
{
10231019
oi = wl->current_output;
10241020
output = oi->output;
10251021
RARCH_LOG("[Wayland] Auto fullscreen on display \"%s\" \"%s\".\n", oi->make, oi->model);
10261022
}
1023+
#endif
10271024
else
10281025
{
10291026
wl_list_for_each(od, &wl->all_outputs, link)
@@ -1036,10 +1033,10 @@ bool gfx_ctx_wl_set_video_mode_common_fullscreen(gfx_ctx_wayland_data_t *wl,
10361033
break;
10371034
}
10381035
};
1039-
}
10401036

1041-
if (!output)
1042-
RARCH_LOG("[Wayland] Failed to specify monitor for fullscreen, letting compositor decide.\n");
1037+
if (!output)
1038+
RARCH_LOG("[Wayland] Failed to specify monitor for fullscreen, letting compositor decide.\n");
1039+
}
10431040

10441041
#ifdef HAVE_LIBDECOR_H
10451042
if (wl->libdecor)

0 commit comments

Comments
 (0)