Re: Window with no maximize button



On Mon, Sep 17, 2007 at 05:01:05PM +0530, aniket ray wrote:
I wanted to create a Window with only the minimize and close decoration
buttons (and no maximize button).

The code of what I basically did was:
windowPointer = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_realize(windowPointer);
mainWindow = windowPointer->window;
gdk_window_set_decorations(mainWindow, GDK_DECOR_BORDER | GDK_DECOR_RESIZEH
| GDK_DECOR_TITLE | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE); //everything but
maximize
gtk_widget_show(windowPointer);


This does not seem to work as I still get the maximize button on the window.
I am using an FC6, with default GNOME installation (and its Metacity WM).
On the other hand, if I give a DIALOG hint to the window with
gtk_window_set_type_hint(), I am able to remove the maximize and minimize
buttons.
Is there a difference in which the 2 methods send hints to the WM?

The DIALOG hint (_NET_WM_WINDOW_TYPE_DIALOG) is an
independent hit.  So it can influence the window manager
decisions independently.

Hints are just hints.  The window manager decides how to
decorate the windows.  Apparently, Metacity thinks it's
a good idea to remove the two buttons from dialogs.  Whatever.
My window manager always shows the buttons I told it and
only them.  Someone else's window manager never shows any
window frame at all.  You cannot rely on window managers
following the hints, some do not even have any meaning with
some window management styles.

Just set the hints logicaally, i.e. do not randomly choose
hints that happen to make your particular window manager
behave as you wish.

How can I
get this to work?

You cannot ultimately control the window decorations.  And
let me immediately add, it's a good thing.

Yeti

--
http://gwyddion.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]