diff options
Diffstat (limited to 'src/event-context.cpp')
| -rw-r--r-- | src/event-context.cpp | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/event-context.cpp b/src/event-context.cpp index 71d4a5fb9..11b814aab 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -54,8 +54,6 @@ #include "sp-guide.h" #include "color.h" -static void sp_event_context_class_init(SPEventContextClass *klass); -static void sp_event_context_init(SPEventContext *event_context); static void sp_event_context_dispose(GObject *object); static void sp_event_context_private_setup(SPEventContext *ec); @@ -66,8 +64,6 @@ static gint sp_event_context_private_item_handler( static void set_event_location(SPDesktop * desktop, GdkEvent * event); -static GObjectClass *parent_class; - // globals for temporary switching to selector by space static bool selector_toggled = FALSE; static int switch_selector_to = 0; @@ -85,22 +81,7 @@ static guint32 scroll_event_time = 0; static gdouble scroll_multiply = 1; static guint scroll_keyval = 0; -/** - * Registers the SPEventContext class with Glib and returns its type number. - */ -GType sp_event_context_get_type(void) { - static GType type = 0; - if (!type) { - GTypeInfo info = { sizeof(SPEventContextClass), NULL, NULL, - (GClassInitFunc) sp_event_context_class_init, NULL, NULL, - sizeof(SPEventContext), 4, - (GInstanceInitFunc) sp_event_context_init, NULL, /* value_table */ - }; - type = g_type_register_static(G_TYPE_OBJECT, "SPEventContext", &info, - (GTypeFlags) 0); - } - return type; -} +G_DEFINE_TYPE(SPEventContext, sp_event_context, G_TYPE_OBJECT); /** * Callback to set up the SPEventContext vtable. @@ -108,8 +89,6 @@ GType sp_event_context_get_type(void) { static void sp_event_context_class_init(SPEventContextClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); - parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(klass)); - object_class->dispose = sp_event_context_dispose; klass->setup = sp_event_context_private_setup; @@ -166,7 +145,7 @@ static void sp_event_context_dispose(GObject *object) { delete ec->_delayed_snap_event; } - G_OBJECT_CLASS(parent_class)->dispose(object); + G_OBJECT_CLASS(sp_event_context_parent_class)->dispose(object); } /** @@ -733,6 +712,7 @@ static gint sp_event_context_private_root_handler( sp_toggle_selector(desktop); ret = TRUE; } + within_tolerance = false; break; case GDK_KEY_Q: case GDK_KEY_q: @@ -1103,7 +1083,7 @@ gint sp_event_context_virtual_item_handler(SPEventContext * event_context, SPIte } /** - * Emits 'position_set' signal on desktop and shows coordinates on status bar. + * Shows coordinates on status bar. */ static void set_event_location(SPDesktop *desktop, GdkEvent *event) { if (event->type != GDK_MOTION_NOTIFY) { @@ -1112,7 +1092,6 @@ static void set_event_location(SPDesktop *desktop, GdkEvent *event) { Geom::Point const button_w(event->button.x, event->button.y); Geom::Point const button_dt(desktop->w2d(button_w)); - desktop->setPosition(button_dt); desktop->set_coordinate_status(button_dt); } |
