GNOME Bugzilla – Bug 587591
Maximize function disabled incorrectly on Win32
Last modified: 2009-11-03 12:48:43 UTC
Please describe the problem: If you write a gtk+ application which sets a maximum size geometry hint on a toplevel window, then it's Maximize functionality is disabled, if the application is built and run on a Win32 platform. This is incorrect. You should still be able to Maximize the window when you have a maximum size constraint. Steps to reproduce: 1. Build and run the supplied test application on Win32 Actual results: The Maximize button on the Windows title bar, and the Maximize menu item in the application pop down menu, are both disabled. Expected results: The Maximize functionality should not be disabled Does this happen every time? Yes Other information: #include <stdlib.h> #include <libintl.h> #include <unistd.h> #include <string.h> #include <glib.h> #include <gdk/gdk.h> #include <gtk/gtk.h> #include <locale.h> static void GuiWindowDestroy(GtkWidget * widget, gpointer data) { gtk_main_quit(); } static void GuiInit() { GdkGeometry windowhints; GtkWindow *window; window = (GtkWindow *) gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(window, 1024, 768 ); gtk_window_set_position(window, GTK_WIN_POS_CENTER); windowhints.max_width = 1024; windowhints.max_height = 768; gtk_window_set_geometry_hints( window, NULL, &windowhints, GDK_HINT_MAX_SIZE ) ; g_signal_connect(window, "destroy", G_CALLBACK(GuiWindowDestroy), (gpointer)NU LL ); gtk_widget_show_all(GTK_WIDGET(window)); } int main(int argc, char **arg) { g_thread_init(NULL); gdk_threads_init(); gtk_init(&argc, &arg); setlocale(LC_ALL,"c"); /* needs to be after gtk_init */ GuiInit(); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); return 0;
Hints are hints, there is by definition no guarantee what effect they cause, if any, even on X11.