After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587591 - Maximize function disabled incorrectly on Win32
Maximize function disabled incorrectly on Win32
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.16.x
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-07-02 10:44 UTC by Karl Burgess
Modified: 2009-11-03 12:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Karl Burgess 2009-07-02 10:44:01 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;
Comment 1 Tor Lillqvist 2009-11-03 12:48:43 UTC
Hints are hints, there is by definition no guarantee what effect they cause, if any, even on X11.