WM hints interface




I've been working some on putting more WM hint support
into GDK. So far I have:

typedef enum
{
  GDK_DECOR_ALL         = 1 << 0,
  GDK_DECOR_BORDER      = 1 << 1,
  GDK_DECOR_RESIZEH     = 1 << 2,
  GDK_DECOR_TITLE       = 1 << 3,
  GDK_DECOR_MENU        = 1 << 4,
  GDK_DECOR_MINIMIZE    = 1 << 5,
  GDK_DECOR_MAXIMIZE    = 1 << 6
} GdkWMDecoration;

typedef enum
{
  GDK_FUNC_ALL          = 1 << 0,
  GDK_FUNC_RESIZE       = 1 << 1,
  GDK_FUNC_MOVE         = 1 << 2,
  GDK_FUNC_MINIMIZE     = 1 << 3,
  GDK_FUNC_MAXIMIZE     = 1 << 4,
  GDK_FUNC_CLOSE        = 1 << 5
} GdkWMFunction;

/* Any of icon_window, pixmap, or mask can be NULL */
void          gdk_window_set_icon        (GdkWindow       *window, 
					  GdkWindow       *icon_window,
					  GdkPixmap       *pixmap,
					  GdkBitmap       *mask);
void          gdk_window_set_icon_name   (GdkWindow       *window, 
					  gchar           *name);
void          gdk_window_set_group       (GdkWindow       *window, 
					  GdkWindow       *leader);
void          gdk_window_set_decorations (GdkWindow       *window,
					  GdkWMDecoration  decorations);
void          gdk_window_set_functions   (GdkWindow       *window,
					  GdkWMFunction    functions);

Which seems to cover most of the interesting things from the ICCCM
and Motif hints. I've split it up into separate pieces, figuring
it was worth sacrificing a bit of efficiency to gain a simple
interface, and the ability to add more things later without
going to gdk_window_set_wm_hints(), gdk_window_set_more_hints(),
gdk_window_set_even_more_hints()...

One thing that i haven't provided here is an interface to
XGetIconSizes. It seems to be pretty unimportant, since nobody
much sets the WM_ICON_SIZES in an interesting way. 
(twm, fvwm, wm2, Enlightment don't set it. WindowMaker sets it
to "anything from 1x1 to 64x64 is OK") It could be added in
the future.


What's still to be done is to add support to GTK to make using
these convenient. 

 - An IconWindow widget needs to be created, since icon windows
   have a lot of constraints on them that Window widgets violate.

 - The "most useful" of the hints should be settable with functions
   in the Window class - without having to force-realize the
   widget first. What is "most useful" is up for debate.

Comments?
                                        Owen



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