All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ui/sdl2: remove workaround forcing x11
@ 2023-03-01 14:12 Erico Nunes
  2023-03-01 14:41 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: Erico Nunes @ 2023-03-01 14:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Erico Nunes

This workaround was put in place in the original implementation almost
10 years ago, considering a very old SDL2 version. Currently it prevents
users to run in a wayland-only environment without manually forcing the
backend.
The SDL2 wayland backend has been supported by distributions for a very
long time (e.g. in Fedora, first available 8 years ago), and is now
considered stable and becoming the default for new SDL2 releases.
Instead of requiring the x11 backend to exist by default, let new qemu
releases run with the default chosen by the installed SDL2 version.

Signed-off-by: Erico Nunes <ernunes@redhat.com>
---
 ui/sdl2.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 8cb77416af..03f353232f 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -825,22 +825,6 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
 
     assert(o->type == DISPLAY_TYPE_SDL);
 
-#ifdef __linux__
-    /* on Linux, SDL may use fbcon|directfb|svgalib when run without
-     * accessible $DISPLAY to open X11 window.  This is often the case
-     * when qemu is run using sudo.  But in this case, and when actually
-     * run in X11 environment, SDL fights with X11 for the video card,
-     * making current display unavailable, often until reboot.
-     * So make x11 the default SDL video driver if this variable is unset.
-     * This is a bit hackish but saves us from bigger problem.
-     * Maybe it's a good idea to fix this in SDL instead.
-     */
-    if (!g_setenv("SDL_VIDEODRIVER", "x11", 0)) {
-        fprintf(stderr, "Could not set SDL_VIDEODRIVER environment variable\n");
-        exit(1);
-    }
-#endif
-
     if (SDL_Init(SDL_INIT_VIDEO)) {
         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
                 SDL_GetError());
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ui/sdl2: remove workaround forcing x11
  2023-03-01 14:12 [PATCH] ui/sdl2: remove workaround forcing x11 Erico Nunes
@ 2023-03-01 14:41 ` Daniel P. Berrangé
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2023-03-01 14:41 UTC (permalink / raw)
  To: Erico Nunes; +Cc: qemu-devel

On Wed, Mar 01, 2023 at 03:12:05PM +0100, Erico Nunes wrote:
> This workaround was put in place in the original implementation almost
> 10 years ago, considering a very old SDL2 version. Currently it prevents
> users to run in a wayland-only environment without manually forcing the
> backend.
> The SDL2 wayland backend has been supported by distributions for a very
> long time (e.g. in Fedora, first available 8 years ago), and is now
> considered stable and becoming the default for new SDL2 releases.
> Instead of requiring the x11 backend to exist by default, let new qemu
> releases run with the default chosen by the installed SDL2 version.

As the comment says, it is better fixed elsewhere anyway rather
than hardcoding in QEMU

> 
> Signed-off-by: Erico Nunes <ernunes@redhat.com>
> ---
>  ui/sdl2.c | 16 ----------------
>  1 file changed, 16 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-01 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 14:12 [PATCH] ui/sdl2: remove workaround forcing x11 Erico Nunes
2023-03-01 14:41 ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.