From: Dongwon Kim <dongwon.kim@intel.com>
To: qemu-devel@nongnu.org
Cc: "Dongwon Kim" <dongwon.kim@intel.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH] ui/gtk: full-screening all detached windows
Date: Thu, 12 Oct 2023 15:24:38 -0700 [thread overview]
Message-ID: <20231012222438.13853-1-dongwon.kim@intel.com> (raw)
When turning on or off full-screen menu, all detached windows should
be full-screened or un-full-screened altogether.
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
ui/gtk.c | 44 ++++++++++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 10 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index 935de1209b..3a380f8d59 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1452,29 +1452,53 @@ static void gd_accel_show_menubar(void *opaque)
static void gd_menu_full_screen(GtkMenuItem *item, void *opaque)
{
GtkDisplayState *s = opaque;
- VirtualConsole *vc = gd_vc_find_current(s);
+ VirtualConsole *vc;
+ int i;
if (!s->full_screen) {
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(s->notebook), FALSE);
gtk_widget_hide(s->menu_bar);
- if (vc->type == GD_VC_GFX) {
- gtk_widget_set_size_request(vc->gfx.drawing_area, -1, -1);
- }
- gtk_window_fullscreen(GTK_WINDOW(s->window));
s->full_screen = TRUE;
+ gtk_window_fullscreen(GTK_WINDOW(s->window));
+
+ for (i = 0; i < s->nb_vcs; i++) {
+ vc = &s->vc[i];
+ if (!vc->window) {
+ continue;
+ }
+ if (vc->type == GD_VC_GFX) {
+ gtk_widget_set_size_request(vc->gfx.drawing_area, -1, -1);
+ }
+ gtk_window_fullscreen(GTK_WINDOW(vc->window));
+ }
} else {
gtk_window_unfullscreen(GTK_WINDOW(s->window));
+
+ for (i = 0; i < s->nb_vcs; i++) {
+ vc = &s->vc[i];
+ if (!vc->window) {
+ continue;
+ }
+ gtk_window_unfullscreen(GTK_WINDOW(vc->window));
+
+ if (vc->type == GD_VC_GFX) {
+ vc->gfx.scale_x = 1.0;
+ vc->gfx.scale_y = 1.0;
+ gd_update_windowsize(vc);
+ }
+ }
+
gd_menu_show_tabs(GTK_MENU_ITEM(s->show_tabs_item), s);
if (gtk_check_menu_item_get_active(
GTK_CHECK_MENU_ITEM(s->show_menubar_item))) {
gtk_widget_show(s->menu_bar);
}
s->full_screen = FALSE;
- if (vc->type == GD_VC_GFX) {
- vc->gfx.scale_x = 1.0;
- vc->gfx.scale_y = 1.0;
- gd_update_windowsize(vc);
- }
+ }
+
+ vc = gd_vc_find_current(s);
+ if (!vc) {
+ return;
}
gd_update_cursor(vc);
--
2.20.1
next reply other threads:[~2023-10-12 22:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 22:24 Dongwon Kim [this message]
2023-10-16 12:34 ` [PATCH] ui/gtk: full-screening all detached windows Marc-André Lureau
2023-10-17 23:44 ` Kim, Dongwon
2023-10-18 6:17 ` Marc-André Lureau
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=20231012222438.13853-1-dongwon.kim@intel.com \
--to=dongwon.kim@intel.com \
--cc=marcandre.lureau@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 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).