display.c File Reference

Handles operations on an X display. More...

Go to the source code of this file.

Data Structures

struct  MetaPingData
 Describes a ping on a window. More...
struct  MetaAutoRaiseData

Defines

#define GRAB_OP_IS_WINDOW_SWITCH(g)
#define item(x)   #x,
#define item(x)   the_display->atom_##x = atoms[i++];
#define GRAB_MASK
#define MAX_FOCUS_BUTTON   4
#define PING_TIMEOUT_DELAY   2250
 How long, in milliseconds, we should wait after pinging a window before deciding it's not going to get back to us.
#define IN_TAB_CHAIN(w, t)
#define N_TARGETS   4

Functions

static void meta_spew_event (MetaDisplay *display, XEvent *event)
static gboolean event_callback (XEvent *event, gpointer data)
 This is the most important function in the whole program.
static Window event_get_modified_window (MetaDisplay *display, XEvent *event)
static guint32 event_get_time (MetaDisplay *display, XEvent *event)
static void process_request_frame_extents (MetaDisplay *display, XEvent *event)
static void process_pong_message (MetaDisplay *display, XEvent *event)
 Process the pong (the response message) from the ping we sent to the window.
static void process_selection_request (MetaDisplay *display, XEvent *event)
static void process_selection_clear (MetaDisplay *display, XEvent *event)
static void update_window_grab_modifiers (MetaDisplay *display)
static void prefs_changed_callback (MetaPreference pref, void *data)
static void sanity_check_timestamps (MetaDisplay *display, guint32 known_good_timestamp)
MetaGroupget_focussed_group (MetaDisplay *display)
static void ping_data_free (MetaPingData *ping_data)
 Destructor for MetaPingData structs.
static void remove_pending_pings_for_window (MetaDisplay *display, Window xwindow)
 Frees every pending ping structure for the given X window on the given display.
static void sn_error_trap_push (SnDisplay *sn_display, Display *xdisplay)
static void sn_error_trap_pop (SnDisplay *sn_display, Display *xdisplay)
static void enable_compositor (MetaDisplay *display, gboolean composite_windows)
static void disable_compositor (MetaDisplay *display)
static void listify_func (gpointer key, gpointer value, gpointer data)
static gint ptrcmp (gconstpointer a, gconstpointer b)
GSList * meta_display_list_windows (MetaDisplay *display)
void meta_display_close (MetaDisplay *display, guint32 timestamp)
MetaScreenmeta_display_screen_for_root (MetaDisplay *display, Window xroot)
MetaScreenmeta_display_screen_for_xwindow (MetaDisplay *display, Window xwindow)
MetaScreenmeta_display_screen_for_x_screen (MetaDisplay *display, Screen *xscreen)
void meta_display_grab (MetaDisplay *display)
void meta_display_ungrab (MetaDisplay *display)
MetaDisplaymeta_display_for_x_display (Display *xdisplay)
 Returns the singleton MetaDisplay if "xdisplay" matches the X display it's managing; otherwise gives a warning and returns NULL.
MetaDisplaymeta_get_display (void)
 Accessor for the singleton MetaDisplay.
static gboolean grab_op_is_mouse_only (MetaGrabOp op)
static gboolean grab_op_is_mouse (MetaGrabOp op)
static gboolean grab_op_is_keyboard (MetaGrabOp op)
gboolean meta_grab_op_is_resizing (MetaGrabOp op)
gboolean meta_grab_op_is_moving (MetaGrabOp op)
guint32 meta_display_get_current_time (MetaDisplay *display)
guint32 meta_display_get_current_time_roundtrip (MetaDisplay *display)
static void add_ignored_serial (MetaDisplay *display, unsigned long serial)
static gboolean serial_is_ignored (MetaDisplay *display, unsigned long serial)
static void reset_ignores (MetaDisplay *display)
static gboolean window_raise_with_delay_callback (void *data)
void meta_display_queue_autoraise_callback (MetaDisplay *display, MetaWindow *window)
const char * meta_event_detail_to_string (int d)
const char * meta_event_mode_to_string (int m)
static const char * stack_mode_to_string (int mode)
static char * key_event_description (Display *xdisplay, XEvent *event)
static gint64 sync_value_to_64 (const XSyncValue *value)
static const char * alarm_state_to_string (XSyncAlarmState state)
MetaWindowmeta_display_lookup_x_window (MetaDisplay *display, Window xwindow)
void meta_display_register_x_window (MetaDisplay *display, Window *xwindowp, MetaWindow *window)
void meta_display_unregister_x_window (MetaDisplay *display, Window xwindow)
gboolean meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display, Window xwindow)
Cursor meta_display_create_x_cursor (MetaDisplay *display, MetaCursor cursor)
static Cursor xcursor_for_op (MetaDisplay *display, MetaGrabOp op)
void meta_display_set_grab_op_cursor (MetaDisplay *display, MetaScreen *screen, MetaGrabOp op, gboolean change_pointer, Window grab_xwindow, guint32 timestamp)
gboolean meta_display_begin_grab_op (MetaDisplay *display, MetaScreen *screen, MetaWindow *window, MetaGrabOp op, gboolean pointer_already_grabbed, gboolean frame_action, int button, gulong modmask, guint32 timestamp, int root_x, int root_y)
void meta_display_end_grab_op (MetaDisplay *display, guint32 timestamp)
void meta_display_check_threshold_reached (MetaDisplay *display, int x, int y)
static void meta_change_button_grab (MetaDisplay *display, Window xwindow, gboolean grab, gboolean sync, int button, int modmask)
void meta_display_grab_window_buttons (MetaDisplay *display, Window xwindow)
void meta_display_ungrab_window_buttons (MetaDisplay *display, Window xwindow)
void meta_display_grab_focus_window_button (MetaDisplay *display, MetaWindow *window)
void meta_display_ungrab_focus_window_button (MetaDisplay *display, MetaWindow *window)
void meta_display_increment_event_serial (MetaDisplay *display)
void meta_display_update_active_window_hint (MetaDisplay *display)
void meta_display_queue_retheme_all_windows (MetaDisplay *display)
void meta_display_retheme_all (void)
void meta_display_set_cursor_theme (const char *theme, int size)
gboolean meta_is_syncing (void)
 Returns whether X synchronisation is currently enabled.
void meta_set_syncing (gboolean setting)
 A handy way to turn on synchronisation on or off for every display.
static gboolean meta_display_ping_timeout (gpointer data)
 Does whatever it is we decided to do when a window didn't respond to a ping.
void meta_display_ping_window (MetaDisplay *display, MetaWindow *window, guint32 timestamp, MetaWindowPingFunc ping_reply_func, MetaWindowPingFunc ping_timeout_func, gpointer user_data)
 Sends a ping request to a window.
gboolean meta_display_window_has_pending_pings (MetaDisplay *display, MetaWindow *window)
 Finds whether a window has any pings waiting on it.
static MetaWindowfind_tab_forward (MetaDisplay *display, MetaTabList type, MetaScreen *screen, MetaWorkspace *workspace, GList *start, gboolean skip_first)
static MetaWindowfind_tab_backward (MetaDisplay *display, MetaTabList type, MetaScreen *screen, MetaWorkspace *workspace, GList *start, gboolean skip_last)
GList * meta_display_get_tab_list (MetaDisplay *display, MetaTabList type, MetaScreen *screen, MetaWorkspace *workspace)
MetaWindowmeta_display_get_tab_next (MetaDisplay *display, MetaTabList type, MetaScreen *screen, MetaWorkspace *workspace, MetaWindow *window, gboolean backward)
MetaWindowmeta_display_get_tab_current (MetaDisplay *display, MetaTabList type, MetaScreen *screen, MetaWorkspace *workspace)
int meta_resize_gravity_from_grab_op (MetaGrabOp op)
static MetaScreenfind_screen_for_selection (MetaDisplay *display, Window owner, Atom selection)
static gboolean convert_property (MetaDisplay *display, MetaScreen *screen, Window w, Atom target, Atom property)
void meta_display_unmanage_screen (MetaDisplay *display, MetaScreen *screen, guint32 timestamp)
void meta_display_unmanage_windows_for_screen (MetaDisplay *display, MetaScreen *screen, guint32 timestamp)
int meta_display_stack_cmp (const void *a, const void *b)
void meta_display_devirtualize_modifiers (MetaDisplay *display, MetaVirtualModifier modifiers, unsigned int *mask)
void meta_display_increment_focus_sentinel (MetaDisplay *display)
void meta_display_decrement_focus_sentinel (MetaDisplay *display)
gboolean meta_display_focus_sentinel_clear (MetaDisplay *display)
static gboolean timestamp_too_old (MetaDisplay *display, MetaWindow *window, guint32 *timestamp)
void meta_display_set_input_focus_window (MetaDisplay *display, MetaWindow *window, gboolean focus_frame, guint32 timestamp)
void meta_display_focus_the_no_focus_window (MetaDisplay *display, MetaScreen *screen, guint32 timestamp)
void meta_display_remove_autoraise_callback (MetaDisplay *display)
void meta_display_get_compositor_version (MetaDisplay *display, int *major, int *minor)
Display * meta_display_get_xdisplay (MetaDisplay *display)
MetaCompositormeta_display_get_compositor (MetaDisplay *display)
GSList * meta_display_get_screens (MetaDisplay *display)
gboolean meta_display_has_shape (MetaDisplay *display)
MetaWindowmeta_display_get_focus_window (MetaDisplay *display)
int meta_display_get_damage_event_base (MetaDisplay *display)
int meta_display_get_shape_event_base (MetaDisplay *display)

Variables

static MetaDisplaythe_display = NULL
 The display we're managing.
static gboolean dump_events = TRUE
static gboolean is_syncing = FALSE
 Stores whether syncing is currently enabled.


Detailed Description

Handles operations on an X display.

The display is represented as a MetaDisplay struct.

Definition in file display.c.


Define Documentation

#define GRAB_MASK

Value:

(PointerMotionMask |                          \
                   ButtonPressMask | ButtonReleaseMask |        \
                   EnterWindowMask | LeaveWindowMask)

Referenced by meta_display_set_grab_op_cursor().

#define GRAB_OP_IS_WINDOW_SWITCH (  ) 

#define IN_TAB_CHAIN ( w,
 ) 

#define item (  )     the_display->atom_##x = atoms[i++];

#define item (  )     #x,

#define MAX_FOCUS_BUTTON   4

#define N_TARGETS   4

Referenced by convert_property().

#define PING_TIMEOUT_DELAY   2250

How long, in milliseconds, we should wait after pinging a window before deciding it's not going to get back to us.

Definition at line 4011 of file display.c.

Referenced by meta_display_ping_window().


Function Documentation

static void add_ignored_serial ( MetaDisplay display,
unsigned long  serial 
) [static]

Definition at line 1228 of file display.c.

References _MetaDisplay::ignored_serials, and N_IGNORED_SERIALS.

Referenced by event_callback().

static const char* alarm_state_to_string ( XSyncAlarmState  state  )  [static]

Definition at line 2672 of file display.c.

Referenced by meta_spew_event().

static gboolean convert_property ( MetaDisplay display,
MetaScreen screen,
Window  w,
Atom  target,
Atom  property 
) [static]

static void disable_compositor ( MetaDisplay display  )  [static]

static void enable_compositor ( MetaDisplay display,
gboolean  composite_windows 
) [static]

static gboolean event_callback ( XEvent *  event,
gpointer  data 
) [static]

This is the most important function in the whole program.

It is the heart, it is the nexus, it is the Grand Central Station of Metacity's world. When we create a MetaDisplay, we ask GDK to pass *all* events for *all* windows to this function. So every time anything happens that we might want to know about, this function gets called. You see why it gets a bit busy around here. Most of this function is a ginormous switch statement dealing with all the kinds of events that might turn up.

Parameters:
event The event that just happened
data The MetaDisplay that events are coming from, cast to a gpointer so that it can be sent to a callback

Definition at line 1413 of file display.c.

References _MetaDisplay::active_screen, _MetaScreen::active_workspace, add_ignored_serial(), _MetaDisplay::allow_terminal_deactivation, _MetaWindow::colormap, _MetaDisplay::compositor, _MetaDisplay::current_time, _MetaWindow::desc, event_get_modified_window(), event_get_time(), _MetaDisplay::expected_focus_window, FALSE, _MetaWindow::frame, _MetaDisplay::grab_button, _MetaDisplay::grab_old_window_stacking, _MetaDisplay::grab_op, grab_op_is_keyboard(), grab_op_is_mouse(), GRAB_OP_IS_WINDOW_SWITCH, _MetaDisplay::grab_window, _MetaWindow::has_focus, _MetaWindow::has_move_func, _MetaWindow::has_resize_func, _MetaWindow::has_shape, _MetaRectangle::height, _MetaWindow::mapped, _MetaFrame::mapped, meta_bell_notify(), meta_compositor_process_event(), META_DEBUG_EVENTS, META_DEBUG_FOCUS, META_DEBUG_SHAPES, META_DEBUG_WINDOW_OPS, META_DEBUG_WINDOW_STATE, meta_display_begin_grab_op(), meta_display_decrement_focus_sentinel(), meta_display_end_grab_op(), meta_display_focus_sentinel_clear(), meta_display_focus_the_no_focus_window(), meta_display_get_current_time_roundtrip(), META_DISPLAY_HAS_SHAPE, META_DISPLAY_HAS_XSYNC, meta_display_lookup_group(), meta_display_lookup_x_window(), meta_display_process_key_event(), meta_display_process_mapping_event(), meta_display_queue_autoraise_callback(), meta_display_retheme_all(), meta_display_screen_for_root(), meta_display_xwindow_is_a_no_focus_window(), meta_effect_run_close(), meta_error_trap_pop(), meta_error_trap_push(), meta_event_detail_to_string(), meta_event_mode_to_string(), META_FOCUS_MODE_CLICK, META_FOCUS_MODE_MOUSE, META_FOCUS_MODE_SLOPPY, META_GRAB_OP_MOVING, META_GRAB_OP_NONE, META_GRAB_OP_RESIZING_E, META_GRAB_OP_RESIZING_N, META_GRAB_OP_RESIZING_NE, META_GRAB_OP_RESIZING_NW, META_GRAB_OP_RESIZING_S, META_GRAB_OP_RESIZING_SE, META_GRAB_OP_RESIZING_SW, META_GRAB_OP_RESIZING_W, meta_group_property_notify(), meta_is_verbose(), meta_prefs_get_application_based(), meta_prefs_get_auto_raise(), meta_prefs_get_focus_mode(), meta_prefs_get_raise_on_click(), meta_prefs_get_theme(), meta_prefs_set_num_workspaces(), META_QUEUE_MOVE_RESIZE, meta_restart(), meta_screen_get_workspace_by_index(), meta_screen_resize(), meta_screen_show_desktop(), meta_screen_unshow_desktop(), meta_screen_update_workspace_layout(), meta_screen_update_workspace_names(), meta_set_keybindings_disabled(), meta_set_verbose(), meta_spew_event(), meta_stack_set_positions(), meta_ui_set_current_theme(), meta_ui_window_should_not_cause_focus(), meta_warning(), meta_window_change_workspace(), meta_window_client_message(), meta_window_configure_request(), META_WINDOW_DESKTOP, meta_window_destroy_frame(), META_WINDOW_DOCK, meta_window_focus(), meta_window_free(), meta_window_get_position(), meta_window_handle_mouse_grab_op_event(), meta_window_lower(), meta_window_new(), meta_window_notify_focus(), meta_window_property_notify(), meta_window_queue(), meta_window_raise(), meta_window_same_application(), meta_window_set_user_time(), meta_window_show_menu(), meta_window_unminimize(), meta_workspace_activate(), meta_workspace_focus_default_window(), _MetaWindow::minimized, _MetaDisplay::mouse_mode, _MetaFrame::need_reapply_frame_shape, NULL, process_pong_message(), process_request_frame_extents(), process_selection_clear(), process_selection_request(), _MetaWindow::rect, reset_ignores(), sanity_check_timestamps(), _MetaWindow::screen, serial_is_ignored(), _MetaScreen::stack, TRUE, _MetaWindow::type, _MetaDisplay::ungrab_should_not_cause_focus_window, _MetaWindow::unmaps_pending, _MetaWindow::user_time_window, _MetaRectangle::width, _MetaFrame::window, _MetaDisplay::window_grab_modifiers, _MetaWindow::withdrawn, _MetaWindow::workspace, _MetaDisplay::xdisplay, _MetaDisplay::xinerama_cache_invalidated, _MetaScreen::xscreen, XSERVER_TIME_IS_BEFORE, and _MetaFrame::xwindow.

Referenced by meta_display_close().

static Window event_get_modified_window ( MetaDisplay display,
XEvent *  event 
) [static]

Definition at line 2414 of file display.c.

References META_DISPLAY_HAS_SHAPE.

Referenced by event_callback().

static guint32 event_get_time ( MetaDisplay display,
XEvent *  event 
) [static]

Definition at line 2493 of file display.c.

Referenced by event_callback().

static MetaScreen* find_screen_for_selection ( MetaDisplay display,
Window  owner,
Atom  selection 
) [static]

static MetaWindow* find_tab_backward ( MetaDisplay display,
MetaTabList  type,
MetaScreen screen,
MetaWorkspace workspace,
GList *  start,
gboolean  skip_last 
) [static]

Definition at line 4333 of file display.c.

References IN_TAB_CHAIN, _MetaWorkspace::mru_list, NULL, and _MetaWindow::screen.

Referenced by meta_display_get_tab_next().

static MetaWindow* find_tab_forward ( MetaDisplay display,
MetaTabList  type,
MetaScreen screen,
MetaWorkspace workspace,
GList *  start,
gboolean  skip_first 
) [static]

Definition at line 4291 of file display.c.

References IN_TAB_CHAIN, _MetaWorkspace::mru_list, NULL, and _MetaWindow::screen.

Referenced by meta_display_get_tab_next().

MetaGroup * get_focussed_group ( MetaDisplay display  ) 

Definition at line 4278 of file display.c.

References NULL.

static gboolean grab_op_is_keyboard ( MetaGrabOp  op  )  [static]

static gboolean grab_op_is_mouse ( MetaGrabOp  op  )  [static]

static gboolean grab_op_is_mouse_only ( MetaGrabOp  op  )  [static]

static char* key_event_description ( Display *  xdisplay,
XEvent *  event 
) [static]

Definition at line 2641 of file display.c.

Referenced by meta_spew_event().

static void listify_func ( gpointer  key,
gpointer  value,
gpointer  data 
) [static]

static void meta_change_button_grab ( MetaDisplay display,
Window  xwindow,
gboolean  grab,
gboolean  sync,
int  button,
int  modmask 
) [static]

gboolean meta_display_begin_grab_op ( MetaDisplay display,
MetaScreen screen,
MetaWindow window,
MetaGrabOp  op,
gboolean  pointer_already_grabbed,
gboolean  frame_action,
int  button,
gulong  modmask,
guint32  timestamp,
int  root_x,
int  root_y 
)

Definition at line 3236 of file display.c.

References _MetaDisplay::compositor, _MetaWindow::desc, FALSE, _MetaWindow::frame, _MetaDisplay::grab_anchor_root_x, _MetaDisplay::grab_anchor_root_y, _MetaDisplay::grab_anchor_window_pos, _MetaDisplay::grab_button, _MetaDisplay::grab_frame_action, _MetaDisplay::grab_have_keyboard, _MetaDisplay::grab_have_pointer, _MetaDisplay::grab_initial_window_pos, _MetaDisplay::grab_initial_x, _MetaDisplay::grab_initial_y, _MetaDisplay::grab_last_moveresize_time, _MetaDisplay::grab_last_user_action_was_snap, _MetaDisplay::grab_latest_motion_x, _MetaDisplay::grab_latest_motion_y, _MetaDisplay::grab_mask, _MetaDisplay::grab_motion_notify_time, _MetaDisplay::grab_old_window_stacking, _MetaDisplay::grab_op, grab_op_is_keyboard(), grab_op_is_mouse(), grab_op_is_mouse_only(), GRAB_OP_IS_WINDOW_SWITCH, _MetaDisplay::grab_resize_timeout_id, _MetaDisplay::grab_screen, _MetaDisplay::grab_threshold_movement_reached, _MetaDisplay::grab_was_cancelled, _MetaDisplay::grab_window, _MetaDisplay::grab_wireframe_active, _MetaDisplay::grab_xwindow, meta_compositor_begin_move(), META_DEBUG_RESIZING, META_DEBUG_WINDOW_OPS, meta_display_compute_resistance_and_snapping_edges(), meta_display_set_grab_op_cursor(), meta_error_trap_pop_with_return(), meta_error_trap_push_with_return(), meta_grab_op_is_moving(), meta_grab_op_is_resizing(), META_GRAB_OP_KEYBOARD_ESCAPING_DOCK, META_GRAB_OP_KEYBOARD_ESCAPING_GROUP, META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL, META_GRAB_OP_KEYBOARD_TABBING_DOCK, META_GRAB_OP_KEYBOARD_TABBING_GROUP, META_GRAB_OP_KEYBOARD_TABBING_NORMAL, META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING, META_GRAB_OP_NONE, meta_prefs_get_gnome_accessibility(), meta_prefs_get_raise_on_click(), meta_prefs_get_reduced_resources(), meta_screen_ensure_tab_popup(), meta_screen_ensure_workspace_popup(), meta_screen_grab_all_keys(), meta_stack_get_positions(), META_TAB_LIST_DOCKS, META_TAB_LIST_GROUP, META_TAB_LIST_NORMAL, META_TAB_SHOW_ICON, META_TAB_SHOW_INSTANTLY, meta_warning(), meta_window_begin_wireframe(), meta_window_calc_showing(), meta_window_get_client_root_coords(), meta_window_grab_all_keys(), meta_window_raise(), meta_window_refresh_resize_popup(), NULL, _MetaWindow::rect, _MetaScreen::stack, _MetaWindow::sync_request_counter, _MetaWindow::sync_request_serial, _MetaWindow::sync_request_time, TRUE, _MetaDisplay::xdisplay, _MetaScreen::xroot, _MetaWindow::xwindow, and _MetaFrame::xwindow.

Referenced by do_choose_window(), event_callback(), handle_workspace_switch(), meta_core_begin_grab_op(), meta_window_begin_grab_op(), and meta_window_client_message().

void meta_display_check_threshold_reached ( MetaDisplay display,
int  x,
int  y 
)

void meta_display_close ( MetaDisplay display,
guint32  timestamp 
)

Cursor meta_display_create_x_cursor ( MetaDisplay display,
MetaCursor  cursor 
)

void meta_display_decrement_focus_sentinel ( MetaDisplay display  ) 

Definition at line 4962 of file display.c.

References _MetaDisplay::sentinel_counter.

Referenced by event_callback().

void meta_display_devirtualize_modifiers ( MetaDisplay display,
MetaVirtualModifier  modifiers,
unsigned int *  mask 
)

void meta_display_end_grab_op ( MetaDisplay display,
guint32  timestamp 
)

Definition at line 3513 of file display.c.

References _MetaDisplay::compositor, FALSE, _MetaDisplay::grab_have_keyboard, _MetaDisplay::grab_have_pointer, _MetaDisplay::grab_old_window_stacking, _MetaDisplay::grab_op, grab_op_is_mouse(), GRAB_OP_IS_WINDOW_SWITCH, _MetaDisplay::grab_resize_popup, _MetaDisplay::grab_resize_timeout_id, _MetaDisplay::grab_screen, _MetaDisplay::grab_threshold_movement_reached, _MetaDisplay::grab_was_cancelled, _MetaDisplay::grab_window, _MetaDisplay::grab_wireframe_active, _MetaDisplay::grab_wireframe_rect, _MetaDisplay::grab_xwindow, _MetaRectangle::height, meta_compositor_end_move(), META_DEBUG_WINDOW_OPS, meta_display_cleanup_edges(), meta_grab_op_is_moving(), meta_grab_op_is_resizing(), META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING, META_GRAB_OP_NONE, meta_prefs_get_raise_on_click(), meta_resize_gravity_from_grab_op(), meta_screen_ungrab_all_keys(), meta_ui_resize_popup_free(), meta_ui_tab_popup_free(), meta_window_calc_showing(), meta_window_end_wireframe(), meta_window_move(), meta_window_raise(), meta_window_resize_with_gravity(), meta_window_ungrab_all_keys(), NULL, _MetaWindow::shaken_loose, _MetaScreen::tab_popup, TRUE, _MetaDisplay::ungrab_should_not_cause_focus_window, _MetaRectangle::width, _MetaRectangle::x, _MetaDisplay::xdisplay, and _MetaRectangle::y.

Referenced by do_choose_window(), event_callback(), handle_workspace_switch(), meta_core_end_grab_op(), meta_display_process_key_event(), meta_window_free(), meta_window_handle_mouse_grab_op_event(), process_tab_grab(), and process_workspace_switch_grab().

gboolean meta_display_focus_sentinel_clear ( MetaDisplay display  ) 

Definition at line 4971 of file display.c.

References _MetaDisplay::sentinel_counter.

Referenced by event_callback().

void meta_display_focus_the_no_focus_window ( MetaDisplay display,
MetaScreen screen,
guint32  timestamp 
)

MetaDisplay* meta_display_for_x_display ( Display *  xdisplay  ) 

Returns the singleton MetaDisplay if "xdisplay" matches the X display it's managing; otherwise gives a warning and returns NULL.

When we were claiming to be able to manage multiple displays, this was supposed to find the display out of the list which matched that display. Now it's merely an extra sanity check.

Parameters:
xdisplay An X display
Returns:
The singleton X display, or NULL if "xdisplay" isn't the one we're managing.

Definition at line 1039 of file display.c.

References meta_warning(), NULL, and _MetaDisplay::xdisplay.

Referenced by get_window(), menu_callback(), meta_core_begin_grab_op(), meta_core_end_grab_op(), meta_core_get(), meta_core_get_grab_button(), meta_core_get_grab_frame(), meta_core_get_grab_op(), meta_core_get_workspace_name_with_index(), meta_core_grab_buttons(), meta_core_increment_event_serial(), meta_screen_for_x_screen(), sn_error_trap_pop(), sn_error_trap_push(), x_error_handler(), and x_io_error_handler().

MetaCompositor* meta_display_get_compositor ( MetaDisplay display  ) 

Definition at line 5146 of file display.c.

References _MetaDisplay::compositor.

void meta_display_get_compositor_version ( MetaDisplay display,
int *  major,
int *  minor 
)

Definition at line 5130 of file display.c.

Referenced by composite_at_least_version().

guint32 meta_display_get_current_time ( MetaDisplay display  ) 

guint32 meta_display_get_current_time_roundtrip ( MetaDisplay display  ) 

int meta_display_get_damage_event_base ( MetaDisplay display  ) 

Definition at line 5171 of file display.c.

Referenced by xrender_process_event().

MetaWindow* meta_display_get_focus_window ( MetaDisplay display  ) 

Definition at line 5164 of file display.c.

Referenced by xrender_manage_screen().

GSList* meta_display_get_screens ( MetaDisplay display  ) 

Definition at line 5152 of file display.c.

References _MetaDisplay::screens.

Referenced by find_window_in_display(), and repair_display().

int meta_display_get_shape_event_base ( MetaDisplay display  ) 

Definition at line 5180 of file display.c.

Referenced by xrender_process_event().

MetaWindow* meta_display_get_tab_current ( MetaDisplay display,
MetaTabList  type,
MetaScreen screen,
MetaWorkspace workspace 
)

Definition at line 4500 of file display.c.

References IN_TAB_CHAIN, meta_window_located_on_workspace(), NULL, and _MetaWindow::screen.

Referenced by do_choose_window().

GList* meta_display_get_tab_list ( MetaDisplay display,
MetaTabList  type,
MetaScreen screen,
MetaWorkspace workspace 
)

MetaWindow* meta_display_get_tab_next ( MetaDisplay display,
MetaTabList  type,
MetaScreen screen,
MetaWorkspace workspace,
MetaWindow window,
gboolean  backward 
)

Display* meta_display_get_xdisplay ( MetaDisplay display  ) 

void meta_display_grab ( MetaDisplay display  ) 

void meta_display_grab_focus_window_button ( MetaDisplay display,
MetaWindow window 
)

void meta_display_grab_window_buttons ( MetaDisplay display,
Window  xwindow 
)

gboolean meta_display_has_shape ( MetaDisplay display  ) 

Definition at line 5158 of file display.c.

References META_DISPLAY_HAS_SHAPE.

Referenced by is_shaped().

void meta_display_increment_event_serial ( MetaDisplay display  ) 

Definition at line 3875 of file display.c.

References _MetaDisplay::leader_window, and _MetaDisplay::xdisplay.

Referenced by meta_core_increment_event_serial().

void meta_display_increment_focus_sentinel ( MetaDisplay display  ) 

GSList* meta_display_list_windows ( MetaDisplay display  ) 

MetaWindow* meta_display_lookup_x_window ( MetaDisplay display,
Window  xwindow 
)

void meta_display_queue_autoraise_callback ( MetaDisplay display,
MetaWindow window 
)

void meta_display_queue_retheme_all_windows ( MetaDisplay display  ) 

void meta_display_register_x_window ( MetaDisplay display,
Window *  xwindowp,
MetaWindow window 
)

void meta_display_remove_autoraise_callback ( MetaDisplay display  ) 

void meta_display_retheme_all ( void   ) 

MetaScreen* meta_display_screen_for_root ( MetaDisplay display,
Window  xroot 
)

MetaScreen* meta_display_screen_for_x_screen ( MetaDisplay display,
Screen *  xscreen 
)

MetaScreen* meta_display_screen_for_xwindow ( MetaDisplay display,
Window  xwindow 
)

void meta_display_set_cursor_theme ( const char *  theme,
int  size 
)

void meta_display_set_grab_op_cursor ( MetaDisplay display,
MetaScreen screen,
MetaGrabOp  op,
gboolean  change_pointer,
Window  grab_xwindow,
guint32  timestamp 
)

void meta_display_set_input_focus_window ( MetaDisplay display,
MetaWindow window,
gboolean  focus_frame,
guint32  timestamp 
)

int meta_display_stack_cmp ( const void *  a,
const void *  b 
)

void meta_display_ungrab ( MetaDisplay display  ) 

void meta_display_ungrab_focus_window_button ( MetaDisplay display,
MetaWindow window 
)

void meta_display_ungrab_window_buttons ( MetaDisplay display,
Window  xwindow 
)

void meta_display_unmanage_screen ( MetaDisplay display,
MetaScreen screen,
guint32  timestamp 
)

void meta_display_unmanage_windows_for_screen ( MetaDisplay display,
MetaScreen screen,
guint32  timestamp 
)

Definition at line 4803 of file display.c.

References meta_display_list_windows(), meta_display_stack_cmp(), meta_window_free(), and NULL.

Referenced by meta_screen_free().

void meta_display_unregister_x_window ( MetaDisplay display,
Window  xwindow 
)

void meta_display_update_active_window_hint ( MetaDisplay display  ) 

gboolean meta_display_xwindow_is_a_no_focus_window ( MetaDisplay display,
Window  xwindow 
)

const char* meta_event_detail_to_string ( int  d  ) 

Definition at line 2550 of file display.c.

Referenced by event_callback(), meta_spew_event(), and meta_window_notify_focus().

const char* meta_event_mode_to_string ( int  m  ) 

Definition at line 2589 of file display.c.

Referenced by event_callback(), meta_spew_event(), and meta_window_notify_focus().

MetaDisplay* meta_get_display ( void   ) 

Accessor for the singleton MetaDisplay.

Returns:
The only MetaDisplay there is. This can be NULL, but only during startup.

Definition at line 1057 of file display.c.

Referenced by main(), meta_display_retheme_all(), meta_display_set_cursor_theme(), meta_invalidate_default_icons(), meta_set_syncing(), release_window_with_fd(), save_state(), search_and_destroy_window(), and warn_about_lame_clients_and_finish_interact().

gboolean meta_grab_op_is_moving ( MetaGrabOp  op  ) 

gboolean meta_grab_op_is_resizing ( MetaGrabOp  op  ) 

gboolean meta_is_syncing ( void   ) 

Returns whether X synchronisation is currently enabled.

Returns:
true if we must wait for events whenever we send X requests; false otherwise.
Bug:
This is *only* called by meta_display_open, but by that time we have already turned syncing on or off on startup, and we don't have any way to do so while Metacity is running, so it's rather pointless.

Definition at line 3985 of file display.c.

int meta_resize_gravity_from_grab_op ( MetaGrabOp  op  ) 

void meta_set_syncing ( gboolean  setting  ) 

A handy way to turn on synchronisation on or off for every display.

Bug:
Of course there is only one display ever anyway, so this can be rather hugely simplified.

Definition at line 3997 of file display.c.

References meta_get_display().

Referenced by main().

static void meta_spew_event ( MetaDisplay display,
XEvent *  event 
) [static]

static void prefs_changed_callback ( MetaPreference  pref,
void *  data 
) [static]

static void process_request_frame_extents ( MetaDisplay display,
XEvent *  event 
) [static]

static void process_selection_clear ( MetaDisplay display,
XEvent *  event 
) [static]

static void process_selection_request ( MetaDisplay display,
XEvent *  event 
) [static]

static gint ptrcmp ( gconstpointer  a,
gconstpointer  b 
) [static]

Definition at line 794 of file display.c.

Referenced by meta_display_list_windows(), and meta_screen_foreach_window().

static void reset_ignores ( MetaDisplay display  )  [static]

static void sanity_check_timestamps ( MetaDisplay display,
guint32  known_good_timestamp 
) [static]

static gboolean serial_is_ignored ( MetaDisplay display,
unsigned long  serial 
) [static]

Definition at line 1249 of file display.c.

References FALSE, _MetaDisplay::ignored_serials, N_IGNORED_SERIALS, and TRUE.

Referenced by event_callback().

static void sn_error_trap_pop ( SnDisplay *  sn_display,
Display *  xdisplay 
) [static]

Definition at line 235 of file display.c.

References FALSE, meta_display_for_x_display(), meta_error_trap_pop(), and NULL.

static void sn_error_trap_push ( SnDisplay *  sn_display,
Display *  xdisplay 
) [static]

Definition at line 225 of file display.c.

References meta_display_for_x_display(), meta_error_trap_push(), and NULL.

static const char* stack_mode_to_string ( int  mode  )  [static]

Definition at line 2619 of file display.c.

Referenced by meta_spew_event().

static gint64 sync_value_to_64 ( const XSyncValue *  value  )  [static]

Definition at line 2659 of file display.c.

Referenced by meta_spew_event().

static gboolean timestamp_too_old ( MetaDisplay display,
MetaWindow window,
guint32 *  timestamp 
) [static]

static void update_window_grab_modifiers ( MetaDisplay display  )  [static]

static gboolean window_raise_with_delay_callback ( void *  data  )  [static]

static Cursor xcursor_for_op ( MetaDisplay display,
MetaGrabOp  op 
) [static]


Variable Documentation

gboolean dump_events = TRUE [static]

Definition at line 1063 of file display.c.

gboolean is_syncing = FALSE [static]

Stores whether syncing is currently enabled.

Definition at line 3971 of file display.c.

MetaDisplay* the_display = NULL [static]

The display we're managing.

This is a singleton object. (Historically, this was a list of displays, but there was never any way to add more than one element to it.) The goofy name is because we don't want it to shadow the parameter in its object methods.

Definition at line 136 of file display.c.


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