[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 10:47:21 +0300 |
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
ui/sdl2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index fbfdb64e90..3d157a14aa 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -576,78 +576,78 @@ static void handle_mousewheel(SDL_Event *ev)
static void handle_windowevent(SDL_Event *ev)
{
struct sdl2_console *scon = get_scon_from_window(ev->window.windowID);
bool allow_close = true;
if (!scon) {
return;
}
switch (ev->window.event) {
case SDL_WINDOWEVENT_RESIZED:
{
QemuUIInfo info;
memset(&info, 0, sizeof(info));
info.width = ev->window.data1;
info.height = ev->window.data2;
dpy_set_ui_info(scon->dcl.con, &info, true);
}
sdl2_redraw(scon);
break;
case SDL_WINDOWEVENT_EXPOSED:
sdl2_redraw(scon);
break;
case SDL_WINDOWEVENT_FOCUS_GAINED:
win32_kbd_set_grab(gui_grab);
if (qemu_console_is_graphic(scon->dcl.con)) {
win32_kbd_set_window(sdl2_win32_get_hwnd(scon));
}
- /* fall through */
+ fallthrough;
case SDL_WINDOWEVENT_ENTER:
if (!gui_grab && (qemu_input_is_absolute(scon->dcl.con) ||
absolute_enabled)) {
absolute_mouse_grab(scon);
}
/* If a new console window opened using a hotkey receives the
* focus, SDL sends another KEYDOWN event to the new window,
* closing the console window immediately after.
*
* Work around this by ignoring further hotkey events until a
* key is released.
*/
scon->ignore_hotkeys = get_mod_state();
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
if (qemu_console_is_graphic(scon->dcl.con)) {
win32_kbd_set_window(NULL);
}
if (gui_grab && !gui_fullscreen) {
sdl_grab_end(scon);
}
break;
case SDL_WINDOWEVENT_RESTORED:
update_displaychangelistener(&scon->dcl, GUI_REFRESH_INTERVAL_DEFAULT);
break;
case SDL_WINDOWEVENT_MINIMIZED:
update_displaychangelistener(&scon->dcl, 500);
break;
case SDL_WINDOWEVENT_CLOSE:
if (qemu_console_is_graphic(scon->dcl.con)) {
if (scon->opts->has_window_close && !scon->opts->window_close) {
allow_close = false;
}
if (allow_close) {
shutdown_action = SHUTDOWN_ACTION_POWEROFF;
qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
}
} else {
SDL_HideWindow(scon->real_window);
scon->hidden = true;
}
break;
case SDL_WINDOWEVENT_SHOWN:
scon->hidden = false;
break;
case SDL_WINDOWEVENT_HIDDEN:
scon->hidden = true;
break;
}
}
--
2.39.2
- [RFC PATCH 08/78] hw/block: add fallthrough pseudo-keyword, (continued)
- [RFC PATCH 08/78] hw/block: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 11/78] hw/timer: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 12/78] hw/usb: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 13/78] hw/adc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 14/78] util/error-report.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 15/78] accel/tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=
- [RFC PATCH 16/78] audio: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 19/78] target/hppa: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 21/78] target/sparc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 23/78] target/arm: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 25/78] target/i386: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 22/78] target/ppc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 24/78] target/alpha: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 20/78] target/mips: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13