Back to index

indicator-appmenu  12.10.0
Defines | Functions
gdk-get-func.c File Reference
#include "config.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include "MwmUtil.h"

Go to the source code of this file.




static MotifWmHintsgdk_xid_get_mwm_hints (Window window)
gboolean egg_xid_get_functions (Window window, GdkWMFunction *functions)
 gdk_window_get_functions: : The toplevel #X11Window to get the functions for : The window functions will be written here

Define Documentation


Definition at line 76 of file gdk-get-func.c.

Function Documentation

gboolean egg_xid_get_functions ( Window  window,
GdkWMFunction *  functions 

gdk_window_get_functions: : The toplevel #X11Window to get the functions for : The window functions will be written here

Returns the functions set on the GdkWindow with #gdk_window_set_functions Returns: TRUE if the window has functions set, FALSE otherwise.

Definition at line 123 of file gdk-get-func.c.

  MotifWmHints *hints;
  gboolean result = FALSE;

  hints = gdk_xid_get_mwm_hints (window);
  if (hints)
      if (hints->flags & MWM_HINTS_FUNCTIONS)
          if (functions)
            *functions = hints->functions;
          result = TRUE;
      XFree (hints);

  return result;

Here is the call graph for this function:

static MotifWmHints* gdk_xid_get_mwm_hints ( Window  window) [static]

Definition at line 81 of file gdk-get-func.c.

  GdkDisplay *display;
  Atom hints_atom = None;
  guchar *data = NULL;
  Atom type;
  gint format;
  gulong nitems;
  gulong bytes_after;
  int ret = 0;
  display = gdk_display_get_default ();
  hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS);

  gdk_error_trap_push ();
  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), window,
                    hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
                    False, AnyPropertyType, &type, &format, &nitems,
                    &bytes_after, &data);
  gdk_flush ();
  if ((ret = gdk_error_trap_pop ()))
      g_warning ("%s: Unable to get hints for %u: Error Code: %d", G_STRFUNC, (guint32)window, ret);
      return NULL;

  if (type == None)
    return NULL;
  return (MotifWmHints *)data;

Here is the caller graph for this function: