All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 8/8] sdl: reorganize -no-frame support
Date: Thu, 25 Jan 2018 15:32:18 +0100	[thread overview]
Message-ID: <20180125143218.29528-9-kraxel@redhat.com> (raw)
In-Reply-To: <20180125143218.29528-1-kraxel@redhat.com>

Drop no_frame flag from sdl_display_init argument list, use a global
variable instead.  This is temporary until -no-frame support is dropped
altogether when we remove sdl1 support.

Remove any traces of noframe from sdl2 code.  It is just dead code as
sdl2 doesn't support the SDL_NOFRAME window flag any more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180115154855.30850-3-kraxel@redhat.com
---
 include/sysemu/sysemu.h | 1 +
 include/ui/console.h    | 5 ++---
 ui/sdl.c                | 9 +++------
 ui/sdl2.c               | 7 +------
 vl.c                    | 4 ++--
 5 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 31612caf10..1c925309e3 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -112,6 +112,7 @@ extern const char *keyboard_layout;
 extern int win2k_install_hack;
 extern int alt_grab;
 extern int ctrl_grab;
+extern int no_frame;
 extern int smp_cpus;
 extern unsigned int max_cpus;
 extern int cursor_hide;
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 0017b4a912..c8f102bb9f 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -50,7 +50,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;
@@ -118,8 +117,9 @@ static void do_sdl_resize(int width, int height, int bpp)
     } else {
         flags |= SDL_RESIZABLE;
     }
-    if (gui_noframe)
+    if (no_frame) {
         flags |= SDL_NOFRAME;
+    }
 
     tmp_screen = SDL_SetVideoMode(width, height, bpp, flags);
     if (!real_screen) {
@@ -895,7 +895,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;
@@ -917,9 +917,6 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     g_printerr("Running QEMU with SDL 1.2 is deprecated, and will be removed\n"
                "in a future release. Please switch to SDL 2.0 instead\n");
 
-    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 1db5dd6f5f..812c315891 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;
@@ -767,7 +766,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;
@@ -775,10 +774,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 e725ecbc08..6ab232095c 100644
--- a/vl.c
+++ b/vl.c
@@ -150,7 +150,7 @@ 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_frame;
 int no_quit = 0;
 static bool grab_on_hover;
 Chardev *serial_hds[MAX_SERIAL_PORTS];
@@ -4694,7 +4694,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);
-- 
2.9.3

  parent reply	other threads:[~2018-01-25 14:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 14:32 [Qemu-devel] [PULL 0/8] Ui 20180125 patches Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 1/8] ui: avoid sign extension using client width/height Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 2/8] ui: convert the SDL2 frontend to keycodemapdb Gerd Hoffmann
2018-02-01 17:28   ` Paolo Bonzini
2018-02-01 17:35     ` Daniel P. Berrangé
2018-02-01 17:37       ` Paolo Bonzini
2018-02-01 17:54         ` Daniel P. Berrangé
2018-02-01 18:10           ` Paolo Bonzini
2018-02-01 18:13             ` Daniel P. Berrangé
2018-01-25 14:32 ` [Qemu-devel] [PULL 3/8] ui: convert GTK and SDL1 frontends " Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 4/8] ui: add fix for GTK Pause key handling on Win32 Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 5/8] ui: ignore hardware keycode 255 on win32 Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 6/8] ui: deprecate use of SDL 1.2 in favour of 2.0 series Gerd Hoffmann
2018-01-25 14:32 ` [Qemu-devel] [PULL 7/8] sdl: use ctrl-alt-g as grab hotkey Gerd Hoffmann
2018-01-25 14:32 ` Gerd Hoffmann [this message]
2018-01-26 10:08 ` [Qemu-devel] [PULL 0/8] Ui 20180125 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180125143218.29528-9-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.