qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/5] Ui 20171117 patches
@ 2017-11-17 10:06 Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed Gerd Hoffmann
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:

  Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/ui-20171117-pull-request

for you to fetch changes up to bcf43cdc178ffbd06d0533b6c54e92640817c9c7:

  sdl2: Fix broken display updating after the window is hidden (2017-11-16 09:57:47 +0100)

----------------------------------------------------------------
sdl2 fixes for 2.11

----------------------------------------------------------------

Jindrich Makovicka (5):
  sdl2: Do not quit the emulator when an auxilliary window is closed
  sdl2: Use the same pointer show/hide logic for absolute and relative
    mode
  sdl2: Fix dead keyboard after fullsceen
  sdl2: Do not leave grab when fullscreen
  sdl2: Fix broken display updating after the window is hidden

 ui/sdl2.c | 51 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 28 insertions(+), 23 deletions(-)

-- 
2.9.3

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

* [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
@ 2017-11-17 10:06 ` Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 2/5] sdl2: Use the same pointer show/hide logic for absolute and relative mode Gerd Hoffmann
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jindrich Makovicka, Gerd Hoffmann

From: Jindrich Makovicka <makovick@gmail.com>

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171112193032.9724-3-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 53dd447fd2..05729af971 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -566,9 +566,14 @@ static void handle_windowevent(SDL_Event *ev)
         update_displaychangelistener(&scon->dcl, 500);
         break;
     case SDL_WINDOWEVENT_CLOSE:
-        if (!no_quit) {
-            no_shutdown = 0;
-            qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
+        if (qemu_console_is_graphic(scon->dcl.con)) {
+            if (!no_quit) {
+                no_shutdown = 0;
+                qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
+            }
+        } else {
+            SDL_HideWindow(scon->real_window);
+            scon->hidden = true;
         }
         break;
     case SDL_WINDOWEVENT_SHOWN:
-- 
2.9.3

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

* [Qemu-devel] [PULL 2/5] sdl2: Use the same pointer show/hide logic for absolute and relative mode
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed Gerd Hoffmann
@ 2017-11-17 10:06 ` Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 3/5] sdl2: Fix dead keyboard after fullsceen Gerd Hoffmann
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jindrich Makovicka, Gerd Hoffmann

From: Jindrich Makovicka <makovick@gmail.com>

Also use a proper enum parameter for SDL_ShowCursor

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171112193032.9724-4-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 05729af971..d0f16f60f4 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -169,10 +169,10 @@ static void sdl_hide_cursor(void)
         return;
     }
 
-    if (qemu_input_is_absolute()) {
-        SDL_ShowCursor(1);
-        SDL_SetCursor(sdl_cursor_hidden);
-    } else {
+    SDL_ShowCursor(SDL_DISABLE);
+    SDL_SetCursor(sdl_cursor_hidden);
+
+    if (!qemu_input_is_absolute()) {
         SDL_SetRelativeMouseMode(SDL_TRUE);
     }
 }
@@ -185,14 +185,16 @@ static void sdl_show_cursor(void)
 
     if (!qemu_input_is_absolute()) {
         SDL_SetRelativeMouseMode(SDL_FALSE);
-        SDL_ShowCursor(1);
-        if (guest_cursor &&
-            (gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
-            SDL_SetCursor(guest_sprite);
-        } else {
-            SDL_SetCursor(sdl_cursor_normal);
-        }
     }
+
+    if (guest_cursor &&
+        (gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
+        SDL_SetCursor(guest_sprite);
+    } else {
+        SDL_SetCursor(sdl_cursor_normal);
+    }
+
+    SDL_ShowCursor(SDL_ENABLE);
 }
 
 static void sdl_grab_start(struct sdl2_console *scon)
-- 
2.9.3

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

* [Qemu-devel] [PULL 3/5] sdl2: Fix dead keyboard after fullsceen
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 2/5] sdl2: Use the same pointer show/hide logic for absolute and relative mode Gerd Hoffmann
@ 2017-11-17 10:06 ` Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 4/5] sdl2: Do not leave grab when fullscreen Gerd Hoffmann
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jindrich Makovicka, Gerd Hoffmann

From: Jindrich Makovicka <makovick@gmail.com>

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171112193032.9724-7-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index d0f16f60f4..cf05214f97 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -442,6 +442,7 @@ static void handle_keyup(SDL_Event *ev)
             sdl2_reset_keys(scon);
             return;
         }
+        sdl2_reset_keys(scon);
         gui_keysym = 0;
     }
     if (!gui_keysym) {
-- 
2.9.3

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

* [Qemu-devel] [PULL 4/5] sdl2: Do not leave grab when fullscreen
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2017-11-17 10:06 ` [Qemu-devel] [PULL 3/5] sdl2: Fix dead keyboard after fullsceen Gerd Hoffmann
@ 2017-11-17 10:06 ` Gerd Hoffmann
  2017-11-17 10:06 ` [Qemu-devel] [PULL 5/5] sdl2: Fix broken display updating after the window is hidden Gerd Hoffmann
  2017-11-17 12:20 ` [Qemu-devel] [PULL 0/5] Ui 20171117 patches Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jindrich Makovicka, Gerd Hoffmann

From: Jindrich Makovicka <makovick@gmail.com>

Prevents displaying of a doubled mouse pointer when moving the pointer
to the screen edges when fullscreen.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171112193032.9724-8-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index cf05214f97..8360054094 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -471,8 +471,9 @@ static void handle_mousemotion(SDL_Event *ev)
         SDL_GetWindowSize(scon->real_window, &scr_w, &scr_h);
         max_x = scr_w - 1;
         max_y = scr_h - 1;
-        if (gui_grab && (ev->motion.x == 0 || ev->motion.y == 0 ||
-                         ev->motion.x == max_x || ev->motion.y == max_y)) {
+        if (gui_grab && !gui_fullscreen
+            && (ev->motion.x == 0 || ev->motion.y == 0 ||
+                ev->motion.x == max_x || ev->motion.y == max_y)) {
             sdl_grab_end(scon);
         }
         if (!gui_grab &&
-- 
2.9.3

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

* [Qemu-devel] [PULL 5/5] sdl2: Fix broken display updating after the window is hidden
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
                   ` (3 preceding siblings ...)
  2017-11-17 10:06 ` [Qemu-devel] [PULL 4/5] sdl2: Do not leave grab when fullscreen Gerd Hoffmann
@ 2017-11-17 10:06 ` Gerd Hoffmann
  2017-11-17 12:20 ` [Qemu-devel] [PULL 0/5] Ui 20171117 patches Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2017-11-17 10:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jindrich Makovicka, Gerd Hoffmann

From: Jindrich Makovicka <makovick@gmail.com>

With SDL 2.0.6, calling SDL_ShowWindow during SDL_WINDOWEVENT_HIDDEN
blocks all subsequent display updates.

Instead of trying to override the change, just update the scon->hidden
flag.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171112193032.9724-2-makovick@gmail.com>

This is a partial revert of d3f3a0f453ea590be529079ae214c200bb5ecc1a,
which in turn is a workaround for a SDL bug.  The bug is fixed in 2.0.6,
see https://bugzilla.libsdl.org/show_bug.cgi?id=3410

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/sdl2.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 8360054094..8718cf36b5 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -581,14 +581,10 @@ static void handle_windowevent(SDL_Event *ev)
         }
         break;
     case SDL_WINDOWEVENT_SHOWN:
-        if (scon->hidden) {
-            SDL_HideWindow(scon->real_window);
-        }
+        scon->hidden = false;
         break;
     case SDL_WINDOWEVENT_HIDDEN:
-        if (!scon->hidden) {
-            SDL_ShowWindow(scon->real_window);
-        }
+        scon->hidden = true;
         break;
     }
 }
-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 0/5] Ui 20171117 patches
  2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
                   ` (4 preceding siblings ...)
  2017-11-17 10:06 ` [Qemu-devel] [PULL 5/5] sdl2: Fix broken display updating after the window is hidden Gerd Hoffmann
@ 2017-11-17 12:20 ` Peter Maydell
  5 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2017-11-17 12:20 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 17 November 2017 at 10:06, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
>
>   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/ui-20171117-pull-request
>
> for you to fetch changes up to bcf43cdc178ffbd06d0533b6c54e92640817c9c7:
>
>   sdl2: Fix broken display updating after the window is hidden (2017-11-16 09:57:47 +0100)
>
> ----------------------------------------------------------------
> sdl2 fixes for 2.11
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2017-11-17 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 10:06 [Qemu-devel] [PULL 0/5] Ui 20171117 patches Gerd Hoffmann
2017-11-17 10:06 ` [Qemu-devel] [PULL 1/5] sdl2: Do not quit the emulator when an auxilliary window is closed Gerd Hoffmann
2017-11-17 10:06 ` [Qemu-devel] [PULL 2/5] sdl2: Use the same pointer show/hide logic for absolute and relative mode Gerd Hoffmann
2017-11-17 10:06 ` [Qemu-devel] [PULL 3/5] sdl2: Fix dead keyboard after fullsceen Gerd Hoffmann
2017-11-17 10:06 ` [Qemu-devel] [PULL 4/5] sdl2: Do not leave grab when fullscreen Gerd Hoffmann
2017-11-17 10:06 ` [Qemu-devel] [PULL 5/5] sdl2: Fix broken display updating after the window is hidden Gerd Hoffmann
2017-11-17 12:20 ` [Qemu-devel] [PULL 0/5] Ui 20171117 patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).