diff mbox

[01/24] sdl: remove -no-frame support

Message ID 20171117103046.15943-2-kraxel@redhat.com
State New, archived
Headers show

Commit Message

Gerd Hoffmann Nov. 17, 2017, 10:30 a.m. UTC
SDL2 doesn't support this any more, the SDL_NOFRAME window flag is gone.
Drop the code, print a notice when the option is still used.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h |  5 ++---
 ui/sdl.c             |  8 +-------
 ui/sdl2.c            |  7 +------
 vl.c                 | 15 ++++-----------
 4 files changed, 8 insertions(+), 27 deletions(-)

Comments

Daniel P. Berrangé Nov. 17, 2017, 2:21 p.m. UTC | #1
On Fri, Nov 17, 2017 at 11:30:23AM +0100, Gerd Hoffmann wrote:
> SDL2 doesn't support this any more, the SDL_NOFRAME window flag is gone.
> Drop the code, print a notice when the option is still used.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  include/ui/console.h |  5 ++---
>  ui/sdl.c             |  8 +-------
>  ui/sdl2.c            |  7 +------
>  vl.c                 | 15 ++++-----------
>  4 files changed, 8 insertions(+), 27 deletions(-)

This needs to go through the deprecation process before we can
drop it. There's still time to get it into 2.11 deprecated list
which would cut the time needed to wait for real deletion.

Regards,
Daniel
Gerd Hoffmann Nov. 17, 2017, 2:49 p.m. UTC | #2
On Fri, Nov 17, 2017 at 02:21:30PM +0000, Daniel P. Berrange wrote:
> On Fri, Nov 17, 2017 at 11:30:23AM +0100, Gerd Hoffmann wrote:
> > SDL2 doesn't support this any more, the SDL_NOFRAME window flag is gone.
> > Drop the code, print a notice when the option is still used.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  include/ui/console.h |  5 ++---
> >  ui/sdl.c             |  8 +-------
> >  ui/sdl2.c            |  7 +------
> >  vl.c                 | 15 ++++-----------
> >  4 files changed, 8 insertions(+), 27 deletions(-)
> 
> This needs to go through the deprecation process before we can
> drop it. There's still time to get it into 2.11 deprecated list
> which would cut the time needed to wait for real deletion.

I fail to see the point.  SDL2 simply doesn't support it, so it never
worked with SDL2.  We switched to SDL2 as default recently.  So it seems
fair to me to just say so instead of silently ignoring the option ...

cheers,
  Gerd
Daniel P. Berrangé Nov. 17, 2017, 2:59 p.m. UTC | #3
On Fri, Nov 17, 2017 at 03:49:06PM +0100, Gerd Hoffmann wrote:
> On Fri, Nov 17, 2017 at 02:21:30PM +0000, Daniel P. Berrange wrote:
> > On Fri, Nov 17, 2017 at 11:30:23AM +0100, Gerd Hoffmann wrote:
> > > SDL2 doesn't support this any more, the SDL_NOFRAME window flag is gone.
> > > Drop the code, print a notice when the option is still used.
> > > 
> > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > > ---
> > >  include/ui/console.h |  5 ++---
> > >  ui/sdl.c             |  8 +-------
> > >  ui/sdl2.c            |  7 +------
> > >  vl.c                 | 15 ++++-----------
> > >  4 files changed, 8 insertions(+), 27 deletions(-)
> > 
> > This needs to go through the deprecation process before we can
> > drop it. There's still time to get it into 2.11 deprecated list
> > which would cut the time needed to wait for real deletion.
> 
> I fail to see the point.  SDL2 simply doesn't support it, so it never
> worked with SDL2.  We switched to SDL2 as default recently.  So it seems
> fair to me to just say so instead of silently ignoring the option ...

We still support SDL don't we, which does support it, and which this
option was targetted at ?

Regards,
Daniel
Daniel P. Berrangé Nov. 17, 2017, 3:06 p.m. UTC | #4
On Fri, Nov 17, 2017 at 02:59:54PM +0000, Daniel P. Berrange wrote:
> On Fri, Nov 17, 2017 at 03:49:06PM +0100, Gerd Hoffmann wrote:
> > On Fri, Nov 17, 2017 at 02:21:30PM +0000, Daniel P. Berrange wrote:
> > > On Fri, Nov 17, 2017 at 11:30:23AM +0100, Gerd Hoffmann wrote:
> > > > SDL2 doesn't support this any more, the SDL_NOFRAME window flag is gone.
> > > > Drop the code, print a notice when the option is still used.
> > > > 
> > > > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > > > ---
> > > >  include/ui/console.h |  5 ++---
> > > >  ui/sdl.c             |  8 +-------
> > > >  ui/sdl2.c            |  7 +------
> > > >  vl.c                 | 15 ++++-----------
> > > >  4 files changed, 8 insertions(+), 27 deletions(-)
> > > 
> > > This needs to go through the deprecation process before we can
> > > drop it. There's still time to get it into 2.11 deprecated list
> > > which would cut the time needed to wait for real deletion.
> > 
> > I fail to see the point.  SDL2 simply doesn't support it, so it never
> > worked with SDL2.  We switched to SDL2 as default recently.  So it seems
> > fair to me to just say so instead of silently ignoring the option ...
> 
> We still support SDL don't we, which does support it, and which this
> option was targetted at ?

Perhaps we might even consider deprecating SDL1 as a whole, then the
deprecation of -no-frame is a natural side effect ?

Regards,
Daniel
diff mbox

Patch

diff --git a/include/ui/console.h b/include/ui/console.h
index 580dfc57ee..7b35778444 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -436,7 +436,7 @@  void surface_gl_setup_viewport(QemuGLShader *gls,
 /* sdl.c */
 #ifdef CONFIG_SDL
 void sdl_display_early_init(int opengl);
-void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
+void sdl_display_init(DisplayState *ds, int full_screen);
 #else
 static inline void sdl_display_early_init(int opengl)
 {
@@ -444,8 +444,7 @@  static inline void sdl_display_early_init(int opengl)
     error_report("SDL support is disabled");
     abort();
 }
-static inline void sdl_display_init(DisplayState *ds, int full_screen,
-                                    int no_frame)
+static inline void sdl_display_init(DisplayState *ds, int full_screen)
 {
     /* This must never be called if CONFIG_SDL is disabled */
     error_report("SDL support is disabled");
diff --git a/ui/sdl.c b/ui/sdl.c
index 7b71a9ac58..f3adbb7a64 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -48,7 +48,6 @@  static int gui_saved_width;
 static int gui_saved_height;
 static int gui_saved_grab;
 static int gui_fullscreen;
-static int gui_noframe;
 static int gui_key_modifier_pressed;
 static int gui_keysym;
 static int gui_grab_code = KMOD_LALT | KMOD_LCTRL;
@@ -114,8 +113,6 @@  static void do_sdl_resize(int width, int height, int bpp)
     } else {
         flags |= SDL_RESIZABLE;
     }
-    if (gui_noframe)
-        flags |= SDL_NOFRAME;
 
     tmp_screen = SDL_SetVideoMode(width, height, bpp, flags);
     if (!real_screen) {
@@ -944,7 +941,7 @@  void sdl_display_early_init(int opengl)
     }
 }
 
-void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+void sdl_display_init(DisplayState *ds, int full_screen)
 {
     int flags;
     uint8_t data = 0;
@@ -963,9 +960,6 @@  void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
             exit(1);
     }
 
-    if (no_frame)
-        gui_noframe = 1;
-
     if (!full_screen) {
         setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
     }
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 53dd447fd2..3802a9b477 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -38,7 +38,6 @@  static int gui_grab; /* if true, all keyboard/mouse events are grabbed */
 
 static int gui_saved_grab;
 static int gui_fullscreen;
-static int gui_noframe;
 static int gui_key_modifier_pressed;
 static int gui_keysym;
 static int gui_grab_code = KMOD_LALT | KMOD_LCTRL;
@@ -756,7 +755,7 @@  void sdl_display_early_init(int opengl)
     }
 }
 
-void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+void sdl_display_init(DisplayState *ds, int full_screen)
 {
     int flags;
     uint8_t data = 0;
@@ -764,10 +763,6 @@  void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     int i;
     SDL_SysWMinfo info;
 
-    if (no_frame) {
-        gui_noframe = 1;
-    }
-
 #ifdef __linux__
     /* on Linux, SDL may use fbcon|directfb|svgalib when run without
      * accessible $DISPLAY to open X11 window.  This is often the case
diff --git a/vl.c b/vl.c
index 7372424fa7..4d8553b433 100644
--- a/vl.c
+++ b/vl.c
@@ -151,7 +151,6 @@  static int rtc_date_offset = -1; /* -1 means no change */
 QEMUClockType rtc_clock;
 int vga_interface_type = VGA_NONE;
 static int full_screen = 0;
-static int no_frame = 0;
 int no_quit = 0;
 static bool grab_on_hover;
 Chardev *serial_hds[MAX_SERIAL_PORTS];
@@ -2165,13 +2164,7 @@  static DisplayType select_display(const char *p)
 
             if (strstart(opts, ",frame=", &nextopt)) {
                 opts = nextopt;
-                if (strstart(opts, "on", &nextopt)) {
-                    no_frame = 0;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    no_frame = 1;
-                } else {
-                    goto invalid_sdl_args;
-                }
+                warn_report("frame sdl option is unsupported, ignoring");
             } else if (strstart(opts, ",alt_grab=", &nextopt)) {
                 opts = nextopt;
                 if (strstart(opts, "on", &nextopt)) {
@@ -3784,7 +3777,7 @@  int main(int argc, char **argv, char **envp)
                 full_screen = 1;
                 break;
             case QEMU_OPTION_no_frame:
-                no_frame = 1;
+                warn_report("-no-frame switch is unsupported, ignoring");
                 break;
             case QEMU_OPTION_alt_grab:
                 alt_grab = 1;
@@ -4473,7 +4466,7 @@  int main(int argc, char **argv, char **envp)
 #endif
     }
 
-    if ((no_frame || alt_grab || ctrl_grab) && display_type != DT_SDL) {
+    if ((alt_grab || ctrl_grab) && display_type != DT_SDL) {
         error_report("-no-frame, -alt-grab and -ctrl-grab are only valid "
                      "for SDL, ignoring option");
     }
@@ -4824,7 +4817,7 @@  int main(int argc, char **argv, char **envp)
         curses_display_init(ds, full_screen);
         break;
     case DT_SDL:
-        sdl_display_init(ds, full_screen, no_frame);
+        sdl_display_init(ds, full_screen);
         break;
     case DT_COCOA:
         cocoa_display_init(ds, full_screen);