[gnome-documents] utils: get a GtkEntryClass directly to applt the entry focus hack
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] utils: get a GtkEntryClass directly to applt the entry focus hack
- Date: Mon, 19 Dec 2011 13:16:59 +0000 (UTC)
commit 923156d762513f39514058e0b17910449392b4e8
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Dec 19 14:15:13 2011 +0100
utils: get a GtkEntryClass directly to applt the entry focus hack
Since now we apply the hack to a GtkEntry subclass, just getting the
parent of the object class won't work. Just take the parent class of
GTK_TYPE_ENTRY instead.
src/lib/gd-utils.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index 4096091..41a7678 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -639,12 +639,14 @@ void
gd_entry_focus_hack (GtkWidget *entry,
GdkDevice *device)
{
+ GtkEntryClass *entry_class;
GtkWidgetClass *entry_parent_class;
/* Grab focus will select all the text. We don't want that to happen, so we
* call the parent instance and bypass the selection change. This is probably
* really non-kosher. */
- entry_parent_class = g_type_class_peek_parent (GTK_ENTRY_GET_CLASS (entry));
+ entry_class = g_type_class_peek (GTK_TYPE_ENTRY);
+ entry_parent_class = g_type_class_peek_parent (entry_class);
(entry_parent_class->grab_focus) (entry);
/* send focus-in event */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]