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 94669 - Tool Windows (Gimp Docks) have the wrong type
Tool Windows (Gimp Docks) have the wrong type
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
1.x
Other other
: Normal enhancement
: ---
Assigned To: GIMP Bugs
Daniel Egger
: 108211 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-10-02 11:20 UTC by xavier.bestel
Modified: 2003-03-12 17:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description xavier.bestel 2002-10-02 11:20:53 UTC
The various windows opened by The Gimp don't have the right type (they
aren't true utilities windows). So the window manager doesn't keep them
above the drawing windows.
metacity-window-demo (in the metacity package) contains examples of
different windows types, to which The Gimp should conform.
Comment 1 Sven Neumann 2002-10-08 10:45:44 UTC
There are the following possible window types defined in GDK:

 typedef enum
 {
   GDK_WINDOW_ROOT,
   GDK_WINDOW_TOPLEVEL,
   GDK_WINDOW_CHILD,
   GDK_WINDOW_DIALOG,
   GDK_WINDOW_TEMP,
   GDK_WINDOW_FOREIGN
 } GdkWindowType;

Additionally the following type hints may be given:

 typedef enum
 {
   GDK_WINDOW_TYPE_HINT_NORMAL,
   GDK_WINDOW_TYPE_HINT_DIALOG,
   GDK_WINDOW_TYPE_HINT_MENU,
   GDK_WINDOW_TYPE_HINT_TOOLBAR
 } GdkWindowTypeHint;

What do you think which type and hint would suit best?
Comment 2 xavier.bestel 2002-10-08 15:26:45 UTC
IMHO, all GIMP windows (e.g. the various tool dialogs) should be
"utility windows". But you can try and play with metacity-window-demo
to find good window types for specific windows.

The "utility window" type is a window manager hint, and is implemented
like this in GTK+:

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  set_gtk_window_type (GTK_WINDOW (window),
"_NET_WM_WINDOW_TYPE_UTILITY");
  gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW
(parent_window));



Now I see a problem: all "drawing windows" are potential parents for
the dialogs, and a window can only have one parent I believe.
The solution I see is make all "utility windows" childs of the current
"drawing windows" when the latter becomes active.
Comment 3 xavier.bestel 2002-10-08 15:42:19 UTC
Err ... I forgot, the implementation of set_gtk_window_type() ...

static void
set_gdk_window_type (GdkWindow  *window,
                     const char *type)
{
  Atom atoms[2] = { None, None };

  atoms[0] = XInternAtom (GDK_WINDOW_XDISPLAY (window),
                          type, False);

  XChangeProperty (GDK_WINDOW_XDISPLAY (window),
                   GDK_WINDOW_XWINDOW (window),
                   XInternAtom (GDK_WINDOW_XDISPLAY (window),
"_NET_WM_WINDOW_TYPE", False),
                   XA_ATOM, 32, PropModeReplace,
                   (guchar *)atoms,
                   1);
}

static void
on_realize_set_type (GtkWindow *window,
                     gpointer   data)
{
  const char *type;

  g_return_if_fail (GTK_WIDGET_REALIZED (window));

  type = g_object_get_data (G_OBJECT (window), "meta-window-type");

  g_return_if_fail (type != NULL);

  set_gdk_window_type (GTK_WIDGET (window)->window,
                       type);
}

static void
set_gtk_window_type (GtkWindow  *window,
                     const char *type)
{
  g_object_set_data (G_OBJECT (window), "meta-window-type", (char*) type);

  g_signal_handlers_disconnect_by_func (G_OBJECT (window),
                                        on_realize_set_type,
                                        NULL);

  g_signal_connect_after (G_OBJECT (window),
                          "realize",
                          G_CALLBACK (on_realize_set_type),
                          NULL);

  if (GTK_WIDGET_REALIZED (window))
    set_gdk_window_type (GTK_WIDGET (window)->window,
                         type);
}
Comment 4 Sven Neumann 2002-10-08 16:15:32 UTC
You forgot that The GIMP is not X11 specific. We can't include that
piece of code since it will only work for X11. I also have the
impression that the concept of "utility" windows is specific to the
metacity window manager. We are restricted to the functionality
provided by GDK. I gave you the enums so that you can choose from the
window types that are offered by GDK.

I'm sure that you can find another way to configure your window
manager so that the dock windows behave according to your preferences.
Sawfish for example allows to configure windows according to the
window class and name.

I propose to have this report closed as WONTFIX.
Comment 5 xavier.bestel 2002-10-08 16:37:24 UTC
Well, it shouldn't be Metacity-specific (see
http://www.freedesktop.org/standards/wm-spec/1.2/html/x224.html for
the spec), but I agree it should be in gdk instead ...
Comment 6 Sven Neumann 2002-10-08 17:11:49 UTC
The HEAD branch of GTK+ seems to have support for these window manager
hints. If GTK+-2.2 is released early enough for GIMP-1.4 we can easily
change this.
Comment 7 Sven Neumann 2003-03-12 13:25:35 UTC
2003-03-12  Sven Neumann  <sven@gimp.org>

  * app/widgets/gimpdock.c (gimp_dock_init): set a window type hint
  of GDK_WINDOW_TYPE_HINT_UTILITY for dock windows (fixes bug #94669).

  * app/gui/splash.c (splash_create): set a window type hint of
  GDK_WINDOW_TYPE_HINT_SPLASHSCREEN.
Comment 8 Sven Neumann 2003-03-12 17:22:21 UTC
*** Bug 108211 has been marked as a duplicate of this bug. ***