MetaWindow::focus signal.

This commit is contained in:
Tomas Frydrych 2009-02-02 11:00:13 +00:00
parent 2338611046
commit db273ce50c
2 changed files with 14 additions and 0 deletions

View File

@ -369,6 +369,7 @@ struct _MetaWindowClass
GObjectClass parent_class; GObjectClass parent_class;
void (*workspace_changed) (MetaWindow *window, int old_workspace); void (*workspace_changed) (MetaWindow *window, int old_workspace);
void (*focus) (MetaWindow *window);
}; };
/* These differ from window->has_foo_func in that they consider /* These differ from window->has_foo_func in that they consider

View File

@ -145,6 +145,7 @@ enum {
enum enum
{ {
WORKSPACE_CHANGED, WORKSPACE_CHANGED,
FOCUS,
LAST_SIGNAL LAST_SIGNAL
}; };
@ -256,6 +257,15 @@ meta_window_class_init (MetaWindowClass *klass)
g_cclosure_marshal_VOID__INT, g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
G_TYPE_INT); G_TYPE_INT);
window_signals[FOCUS] =
g_signal_new ("focus",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (MetaWindowClass, focus),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
} }
static void static void
@ -5705,6 +5715,9 @@ meta_window_notify_focus (MetaWindow *window,
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK || if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
!meta_prefs_get_raise_on_click()) !meta_prefs_get_raise_on_click())
meta_display_ungrab_focus_window_button (window->display, window); meta_display_ungrab_focus_window_button (window->display, window);
g_signal_emit (window, window_signals[FOCUS], 0);
} }
} }
else if (event->type == FocusOut || else if (event->type == FocusOut ||