window-props.c File Reference

MetaWindow property handling. More...

Go to the source code of this file.

Data Structures

struct  _MetaWindowPropHooks

Defines

#define _GNU_SOURCE
#define _SVID_SOURCE
#define HOST_NAME_MAX   255
#define MAX_TITLE_LENGTH   512
#define FLAG_TOGGLED_ON(old, new, flag)
#define FLAG_TOGGLED_OFF(old, new, flag)
#define FLAG_CHANGED(old, new, flag)   (FLAG_TOGGLED_ON(old,new,flag) || FLAG_TOGGLED_OFF(old,new,flag))
#define N_HOOKS   26

Typedefs

typedef void(* InitValueFunc )(MetaDisplay *display, Atom property, MetaPropValue *value)
typedef void(* ReloadValueFunc )(MetaWindow *window, MetaPropValue *value)

Functions

static void init_prop_value (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_prop_value (MetaWindow *window, MetaPropValue *value)
static MetaWindowPropHooksfind_hooks (MetaDisplay *display, Atom property)
void meta_window_reload_property (MetaWindow *window, Atom property)
 Requests the current values of a single property for a given window from the server, and deals with it appropriately.
void meta_window_reload_properties (MetaWindow *window, const Atom *properties, int n_properties)
 Requests the current values of a set of properties for a given window from the server, and deals with them appropriately.
void meta_window_reload_property_from_xwindow (MetaWindow *window, Window xwindow, Atom property)
 Requests the current values of a single property for a given window from the server, and deals with it appropriately.
void meta_window_reload_properties_from_xwindow (MetaWindow *window, Window xwindow, const Atom *properties, int n_properties)
 Requests the current values of a set of properties for a given window from the server, and deals with them appropriately.
static void init_wm_client_machine (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_client_machine (MetaWindow *window, MetaPropValue *value)
static void init_net_wm_pid (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_pid (MetaWindow *window, MetaPropValue *value)
static void init_net_wm_user_time (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_user_time (MetaWindow *window, MetaPropValue *value)
static void init_net_wm_user_time_window (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_user_time_window (MetaWindow *window, MetaPropValue *value)
static gboolean set_title_text (MetaWindow *window, gboolean previous_was_modified, const char *title, Atom atom, char **target)
 Called by set_window_title and set_icon_title to set the value of *target to title.
static void set_window_title (MetaWindow *window, const char *title)
static void init_net_wm_name (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_name (MetaWindow *window, MetaPropValue *value)
static void init_wm_name (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_name (MetaWindow *window, MetaPropValue *value)
static void set_icon_title (MetaWindow *window, const char *title)
static void init_net_wm_icon_name (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_icon_name (MetaWindow *window, MetaPropValue *value)
static void init_wm_icon_name (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_icon_name (MetaWindow *window, MetaPropValue *value)
static void init_net_wm_state (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_state (MetaWindow *window, MetaPropValue *value)
static void init_mwm_hints (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_mwm_hints (MetaWindow *window, MetaPropValue *value)
static void init_wm_class (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_class (MetaWindow *window, MetaPropValue *value)
static void init_net_wm_desktop (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_wm_desktop (MetaWindow *window, MetaPropValue *value)
static void init_net_startup_id (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_net_startup_id (MetaWindow *window, MetaPropValue *value)
static void init_update_counter (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_update_counter (MetaWindow *window, MetaPropValue *value)
static void init_normal_hints (MetaDisplay *display, Atom property, MetaPropValue *value)
static void spew_size_hints_differences (const XSizeHints *old, const XSizeHints *new)
void meta_set_normal_hints (MetaWindow *window, XSizeHints *hints)
 Sets the size hints for a window.
static void reload_normal_hints (MetaWindow *window, MetaPropValue *value)
static void init_wm_protocols (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_protocols (MetaWindow *window, MetaPropValue *value)
static void init_wm_hints (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_wm_hints (MetaWindow *window, MetaPropValue *value)
static void init_transient_for (MetaDisplay *display, Atom property, MetaPropValue *value)
static void reload_transient_for (MetaWindow *window, MetaPropValue *value)
void meta_display_init_window_prop_hooks (MetaDisplay *display)
 Initialises the hooks used for the reload_propert* functions on a particular display, and stores a pointer to them in the display.
void meta_display_free_window_prop_hooks (MetaDisplay *display)
 Frees the hooks used for the reload_propert* functions for a particular display.


Detailed Description

MetaWindow property handling.

A system which can inspect sets of properties of given windows and take appropriate action given their values.

Note that all the meta_window_reload_propert* functions require a round trip to the server.

Bug:
Not all the properties have moved over from their original handler in window.c yet.

Definition in file window-props.c.


Define Documentation

#define _GNU_SOURCE

Definition at line 36 of file window-props.c.

#define _SVID_SOURCE

Definition at line 37 of file window-props.c.

#define FLAG_CHANGED ( old,
new,
flag   )     (FLAG_TOGGLED_ON(old,new,flag) || FLAG_TOGGLED_OFF(old,new,flag))

Definition at line 875 of file window-props.c.

Referenced by spew_size_hints_differences().

#define FLAG_TOGGLED_OFF ( old,
new,
flag   ) 

Value:

(((old)->flags & (flag)) != 0 &&      \
  ((new)->flags & (flag)) == 0)

Definition at line 871 of file window-props.c.

#define FLAG_TOGGLED_ON ( old,
new,
flag   ) 

Value:

(((old)->flags & (flag)) == 0 &&     \
  ((new)->flags & (flag)) != 0)

Definition at line 867 of file window-props.c.

Referenced by spew_size_hints_differences().

#define HOST_NAME_MAX   255

Definition at line 50 of file window-props.c.

Referenced by set_title_text().

#define MAX_TITLE_LENGTH   512

Definition at line 301 of file window-props.c.

Referenced by set_title_text().

#define N_HOOKS   26

Definition at line 1454 of file window-props.c.


Typedef Documentation

typedef void(* InitValueFunc)(MetaDisplay *display, Atom property, MetaPropValue *value)

Definition at line 53 of file window-props.c.

typedef void(* ReloadValueFunc)(MetaWindow *window, MetaPropValue *value)

Definition at line 56 of file window-props.c.


Function Documentation

static MetaWindowPropHooks * find_hooks ( MetaDisplay display,
Atom  property 
) [static]

static void init_mwm_hints ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_startup_id ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

Definition at line 786 of file window-props.c.

References MetaPropValue::atom, META_PROP_VALUE_UTF8, and MetaPropValue::type.

static void init_net_wm_desktop ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_icon_name ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_name ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_pid ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_state ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_user_time ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_net_wm_user_time_window ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_normal_hints ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_prop_value ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_transient_for ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_update_counter ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_wm_class ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_wm_client_machine ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

Definition at line 166 of file window-props.c.

References MetaPropValue::atom, META_PROP_VALUE_STRING, and MetaPropValue::type.

static void init_wm_hints ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_wm_icon_name ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_wm_name ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

static void init_wm_protocols ( MetaDisplay display,
Atom  property,
MetaPropValue value 
) [static]

void meta_display_free_window_prop_hooks ( MetaDisplay display  ) 

Frees the hooks used for the reload_propert* functions for a particular display.

Parameters:
display The display.

Definition at line 1606 of file window-props.c.

References NULL, and _MetaDisplay::prop_hooks.

Referenced by meta_display_close().

void meta_display_init_window_prop_hooks ( MetaDisplay display  ) 

void meta_set_normal_hints ( MetaWindow window,
XSizeHints *  hints 
)

Sets the size hints for a window.

This happens when a WM_NORMAL_HINTS property is set on a window, but it is public because the size hints are set to defaults when a window is created. See http://tronche.com/gui/x/icccm/sec-4.html#WM_NORMAL_HINTS for the X details.

Parameters:
window The window to set the size hints on.
hints Either some X size hints, or NULL for default.

Definition at line 928 of file window-props.c.

References _MetaWindow::desc, META_DEBUG_GEOMETRY, and _MetaWindow::size_hints.

Referenced by meta_window_new_with_attrs(), and reload_normal_hints().

void meta_window_reload_properties ( MetaWindow window,
const Atom *  properties,
int  n_properties 
)

Requests the current values of a set of properties for a given window from the server, and deals with them appropriately.

Does not return them to the caller (they've been dealt with!)

Parameters:
window The window.
properties A pointer to a list of X atoms, "n_properties" long.
n_properties The length of the properties list.

Definition at line 83 of file window-props.c.

References meta_window_reload_properties_from_xwindow(), and _MetaWindow::xwindow.

Referenced by meta_window_new_with_attrs(), and meta_window_reload_property().

void meta_window_reload_properties_from_xwindow ( MetaWindow window,
Window  xwindow,
const Atom *  properties,
int  n_properties 
)

Requests the current values of a set of properties for a given window from the server, and deals with them appropriately.

Does not return them to the caller (they've been dealt with!)

Parameters:
window A window on the same display as the one we're investigating (only used to find the display)
xwindow The X handle for the window.
properties A pointer to a list of X atoms, "n_properties" long.
n_properties The length of the properties list.

Definition at line 102 of file window-props.c.

References _MetaWindow::display, init_prop_value(), meta_prop_free_values(), meta_prop_get_values(), NULL, and reload_prop_value().

Referenced by meta_window_reload_properties(), and meta_window_reload_property_from_xwindow().

void meta_window_reload_property ( MetaWindow window,
Atom  property 
)

Requests the current values of a single property for a given window from the server, and deals with it appropriately.

Does not return it to the caller (it's been dealt with!)

Parameters:
window The window.
property A single X atom.

Definition at line 76 of file window-props.c.

References meta_window_reload_properties().

Referenced by process_property_notify().

void meta_window_reload_property_from_xwindow ( MetaWindow window,
Window  xwindow,
Atom  property 
)

Requests the current values of a single property for a given window from the server, and deals with it appropriately.

Does not return it to the caller (it's been dealt with!)

Parameters:
window A window on the same display as the one we're investigating (only used to find the display)
xwindow The X handle for the window.
property A single X atom.

Definition at line 94 of file window-props.c.

References meta_window_reload_properties_from_xwindow().

Referenced by process_property_notify(), and reload_net_wm_user_time_window().

static void reload_mwm_hints ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_startup_id ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_desktop ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_icon_name ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_name ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_pid ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_state ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_user_time ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_net_wm_user_time_window ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_normal_hints ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_prop_value ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_transient_for ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_update_counter ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_class ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_client_machine ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_hints ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_icon_name ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_name ( MetaWindow window,
MetaPropValue value 
) [static]

static void reload_wm_protocols ( MetaWindow window,
MetaPropValue value 
) [static]

static void set_icon_title ( MetaWindow window,
const char *  title 
) [static]

static gboolean set_title_text ( MetaWindow window,
gboolean  previous_was_modified,
const char *  title,
Atom  atom,
char **  target 
) [static]

Called by set_window_title and set_icon_title to set the value of *target to title.

It required and atom is set, it will update the appropriate property.

Returns TRUE if a new title was set.

Definition at line 311 of file window-props.c.

References _, _MetaWindow::display, FALSE, HOST_NAME_MAX, MAX_TITLE_LENGTH, meta_error_trap_pop(), meta_error_trap_push(), meta_g_utf8_strndup(), meta_prop_set_utf8_string_hint(), TRUE, _MetaWindow::wm_client_machine, _MetaDisplay::xdisplay, and _MetaWindow::xwindow.

Referenced by set_icon_title(), and set_window_title().

static void set_window_title ( MetaWindow window,
const char *  title 
) [static]

static void spew_size_hints_differences ( const XSizeHints *  old,
const XSizeHints *  new 
) [static]

Definition at line 879 of file window-props.c.

References FLAG_CHANGED, FLAG_TOGGLED_ON, and META_DEBUG_GEOMETRY.

Referenced by reload_normal_hints().


Generated on Sat Aug 23 22:04:22 2008 for metacity by  doxygen 1.5.5