* [PATCH] ui/gtk: full-screening all detached windows
@ 2023-10-12 22:24 Dongwon Kim
2023-10-16 12:34 ` Marc-André Lureau
0 siblings, 1 reply; 4+ messages in thread
From: Dongwon Kim @ 2023-10-12 22:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Dongwon Kim, Marc-André Lureau
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ui/gtk: full-screening all detached windows
2023-10-12 22:24 [PATCH] ui/gtk: full-screening all detached windows Dongwon Kim
@ 2023-10-16 12:34 ` Marc-André Lureau
2023-10-17 23:44 ` Kim, Dongwon
0 siblings, 1 reply; 4+ messages in thread
From: Marc-André Lureau @ 2023-10-16 12:34 UTC (permalink / raw)
To: Dongwon Kim; +Cc: qemu-devel
Hi
On Fri, Oct 13, 2023 at 2:51 AM Dongwon Kim <dongwon.kim@intel.com> wrote:
>
> When turning on or off full-screen menu, all detached windows should
> be full-screened or un-full-screened altogether.
I am not convinced this is desirable. Not only having multiple
fullscreen windows on the same screen is usually a bit harder to deal
with. You typically want one imho.
But the most annoying thing is probably that detached windows/consoles
do not have the same shortcuts as the main window, and you can't
unfullscreen them then...
Wouldn't you prefer to have a working fullscreen keyboard shortcut for
detached tabs instead? This way, each window can be toggled
full/unfull individually.
thanks
>
> 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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] ui/gtk: full-screening all detached windows
2023-10-16 12:34 ` Marc-André Lureau
@ 2023-10-17 23:44 ` Kim, Dongwon
2023-10-18 6:17 ` Marc-André Lureau
0 siblings, 1 reply; 4+ messages in thread
From: Kim, Dongwon @ 2023-10-17 23:44 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: qemu-devel
Hi Marc-André,
> Hi
>
> On Fri, Oct 13, 2023 at 2:51 AM Dongwon Kim <dongwon.kim@intel.com>
> wrote:
> >
> > When turning on or off full-screen menu, all detached windows should
> > be full-screened or un-full-screened altogether.
>
> I am not convinced this is desirable. Not only having multiple fullscreen windows
> on the same screen is usually a bit harder to deal with. You typically want one
> imho.
>
> But the most annoying thing is probably that detached windows/consoles do not
> have the same shortcuts as the main window, and you can't unfullscreen them
> then...
>
> Wouldn't you prefer to have a working fullscreen keyboard shortcut for
> detached tabs instead? This way, each window can be toggled full/unfull
> individually.
[DW] That is right. Two detached windows on the same display would be overlapped, which will be ugly. I also thought about that as well as other undesirable situations but my initial thought was the full-screen
menu is global and all QEMU windows should be controlled by it. Anyhow, I like your idea about individual control.. so we would probably need to add more full-screen menus, like 'fullscreen1, fullscreen2, fullscreen3..."
to the menu then also assign a hotkey to each one of them?
>
> thanks
>
> >
> > 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
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ui/gtk: full-screening all detached windows
2023-10-17 23:44 ` Kim, Dongwon
@ 2023-10-18 6:17 ` Marc-André Lureau
0 siblings, 0 replies; 4+ messages in thread
From: Marc-André Lureau @ 2023-10-18 6:17 UTC (permalink / raw)
To: Kim, Dongwon; +Cc: qemu-devel
Hi
On Wed, Oct 18, 2023 at 3:45 AM Kim, Dongwon <dongwon.kim@intel.com> wrote:
>
> Hi Marc-André,
>
> > Hi
> >
> > On Fri, Oct 13, 2023 at 2:51 AM Dongwon Kim <dongwon.kim@intel.com>
> > wrote:
> > >
> > > When turning on or off full-screen menu, all detached windows should
> > > be full-screened or un-full-screened altogether.
> >
> > I am not convinced this is desirable. Not only having multiple fullscreen windows
> > on the same screen is usually a bit harder to deal with. You typically want one
> > imho.
> >
> > But the most annoying thing is probably that detached windows/consoles do not
> > have the same shortcuts as the main window, and you can't unfullscreen them
> > then...
> >
> > Wouldn't you prefer to have a working fullscreen keyboard shortcut for
> > detached tabs instead? This way, each window can be toggled full/unfull
> > individually.
>
> [DW] That is right. Two detached windows on the same display would be overlapped, which will be ugly. I also thought about that as well as other undesirable situations but my initial thought was the full-screen
> menu is global and all QEMU windows should be controlled by it. Anyhow, I like your idea about individual control.. so we would probably need to add more full-screen menus, like 'fullscreen1, fullscreen2, fullscreen3..."
> to the menu then also assign a hotkey to each one of them?
The same shortcut should be used, only it applies to the currently
focused window.
>
> >
> > thanks
> >
> > >
> > > 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
> > >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-18 6:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12 22:24 [PATCH] ui/gtk: full-screening all detached windows Dongwon Kim
2023-10-16 12:34 ` Marc-André Lureau
2023-10-17 23:44 ` Kim, Dongwon
2023-10-18 6:17 ` Marc-André Lureau
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.