Skip to content

[linux] implement minimizable & maximizable #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2023
Merged

[linux] implement minimizable & maximizable #270

merged 1 commit into from
Jan 4, 2023

Conversation

jpnurmi
Copy link
Contributor

@jpnurmi jpnurmi commented Jan 4, 2023

These are implemented in terms of the current window state and type to make them match with the native window popup menu (e.g. a dialog always has minimize and maximize items dimmed in the menu).

These are implemented in terms of the current window state and type to
make them match with the native window popup menu (e.g. a dialog always
has minimize and mazimize items dimmed in the menu).
@jpnurmi
Copy link
Contributor Author

jpnurmi commented Jan 4, 2023

Minimize

  menuitem = gtk_menu_item_new_with_label (_("Minimize"));
  gtk_widget_show (menuitem);
  if (iconified ||
      priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
    gtk_widget_set_sensitive (menuitem, FALSE);
  g_signal_connect (G_OBJECT (menuitem), "activate",
                    G_CALLBACK (minimize_window_clicked), window);
  gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);

https://github.com/GNOME/gtk/blob/35516a5e866cd77390eb71d72d5b67f45dc4302c/gtk/gtkwindow.c#L9345-L9352

Maximize

  menuitem = gtk_menu_item_new_with_label (_("Maximize"));
  gtk_widget_show (menuitem);
  if (maximized ||
      !priv->resizable ||
      priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
    gtk_widget_set_sensitive (menuitem, FALSE);
  g_signal_connect (G_OBJECT (menuitem), "activate",
                    G_CALLBACK (maximize_window_clicked), window);
  gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);

https://github.com/GNOME/gtk/blob/35516a5e866cd77390eb71d72d5b67f45dc4302c/gtk/gtkwindow.c#L9354

@lijy91 lijy91 merged commit 3cf24aa into leanflutter:main Jan 4, 2023
@jpnurmi jpnurmi deleted the linux-min-maximizable branch January 4, 2023 14:03
obiwanzenobi pushed a commit to obiwanzenobi/window_manager that referenced this pull request May 25, 2023
These are implemented in terms of the current window state and type to
make them match with the native window popup menu (e.g. a dialog always
has minimize and mazimize items dimmed in the menu).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants