forked from AuroraMiddleware/gtk
a11y: restore window:activate/deactivate emission
1b9aa1b708
('a11y: drop the focus tracker') removed a bit too much. We
still have to emit window:activate/deactivate events. They are easy to
emit anyway.
Fixes #127
This commit is contained in:
parent
572a23b136
commit
62f31015fc
@ -23,10 +23,13 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
void _gtk_accessibility_init (void);
|
void _gtk_accessibility_init (void);
|
||||||
|
|
||||||
gboolean _gtk_accessibility_key_snooper (GtkWidget *widget,
|
gboolean _gtk_accessibility_key_snooper (GtkWidget *widget,
|
||||||
GdkEventKey *event);
|
GdkEventKey *event);
|
||||||
|
|
||||||
|
void _gtk_window_accessible_set_is_active (GtkWindow *window,
|
||||||
|
gboolean is_active);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "gtkaccessibility.h"
|
||||||
#include "gtkwidgetaccessibleprivate.h"
|
#include "gtkwidgetaccessibleprivate.h"
|
||||||
#include "gtkwindowaccessible.h"
|
#include "gtkwindowaccessible.h"
|
||||||
#include "gtktoplevelaccessible.h"
|
#include "gtktoplevelaccessible.h"
|
||||||
|
#include "gtkwidgetprivate.h"
|
||||||
#include "gtkwindowprivate.h"
|
#include "gtkwindowprivate.h"
|
||||||
|
|
||||||
/* atkcomponent.h */
|
/* atkcomponent.h */
|
||||||
@ -442,6 +444,19 @@ gtk_window_accessible_get_size (AtkComponent *component,
|
|||||||
*height = rect.height;
|
*height = rect.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_gtk_window_accessible_set_is_active (GtkWindow *window,
|
||||||
|
gboolean is_active)
|
||||||
|
{
|
||||||
|
AtkObject *accessible = _gtk_widget_peek_accessible (GTK_WIDGET (window));
|
||||||
|
|
||||||
|
if (accessible == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_signal_emit_by_name (accessible, is_active ? "activate" : "deactivate");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
atk_component_interface_init (AtkComponentIface *iface)
|
atk_component_interface_init (AtkComponentIface *iface)
|
||||||
{
|
{
|
||||||
|
@ -10472,6 +10472,7 @@ _gtk_window_set_is_active (GtkWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_IS_ACTIVE]);
|
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_IS_ACTIVE]);
|
||||||
|
_gtk_window_accessible_set_is_active (window, is_active);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user