summaryrefslogtreecommitdiff
path: root/libmdock
diff options
context:
space:
mode:
Diffstat (limited to 'libmdock')
-rw-r--r--libmdock/mdock-item.c2
-rw-r--r--libmdock/mdock-widget.c17
-rw-r--r--libmdock/mdock-window.c8
3 files changed, 13 insertions, 14 deletions
diff --git a/libmdock/mdock-item.c b/libmdock/mdock-item.c
index aa3045f..87a4f49 100644
--- a/libmdock/mdock-item.c
+++ b/libmdock/mdock-item.c
@@ -370,7 +370,7 @@ void mdock_item_remove_window(MDockItem *self, WnckWindow *window)
if (self->priv->last_active == window) {
self->priv->last_active = NULL;
}
- if (self->priv->windows) {
+ if (!self->priv->windows) {
// If there are no windows left,
// we want to redraw in order to remove the "active" indicator.
gtk_widget_queue_draw(GTK_WIDGET(self));
diff --git a/libmdock/mdock-widget.c b/libmdock/mdock-widget.c
index 561a5b4..cd71999 100644
--- a/libmdock/mdock-widget.c
+++ b/libmdock/mdock-widget.c
@@ -218,18 +218,23 @@ static void handle_item_pinned_changed(MDockWidget *self, GParamSpec *spec, MDoc
static gboolean handle_item_button_press(MDockWidget *self, GdkEventButton *event, MDockItem *item)
{
- if (self->priv->popup_timer) {
- g_source_remove(self->priv->popup_timer);
- self->priv->popup_timer = 0;
- }
- if (self->priv->current_popup_item) {
- hide_item_popup(self);
+ if (event->button != 1) {
+ if (self->priv->popup_timer) {
+ g_source_remove(self->priv->popup_timer);
+ self->priv->popup_timer = 0;
+ }
+ if (self->priv->current_popup_item) {
+ hide_item_popup(self);
+ }
}
switch (event->button) {
case 1:
self->priv->primary_button_down = TRUE;
break;
+ case 2:
+ return FALSE; // Let the panel handle a middle button press.
+ break;
case 3:
gtk_menu_popup(GTK_MENU(g_object_get_qdata(G_OBJECT(item), mdock_widget_item_menu_quark())),
NULL, NULL, NULL, NULL, event->button, event->time);
diff --git a/libmdock/mdock-window.c b/libmdock/mdock-window.c
index 7690ce6..c53e7ef 100644
--- a/libmdock/mdock-window.c
+++ b/libmdock/mdock-window.c
@@ -149,7 +149,7 @@ static void mdock_window_constructed(GObject *object)
static void mdock_window_dispose(GObject *object)
{
- MDockWindow *self = MDOCK_WINDOW(self);
+ MDockWindow *self = MDOCK_WINDOW(object);
if (self->priv->screenshot_timeout) {
g_source_remove(self->priv->screenshot_timeout);
self->priv->screenshot_timeout = 0;
@@ -157,11 +157,6 @@ static void mdock_window_dispose(GObject *object)
G_OBJECT_CLASS(mdock_window_parent_class)->dispose(object);
}
-static void mdock_window_finalize(GObject *object)
-{
- G_OBJECT_CLASS(mdock_window_parent_class)->finalize(object);
-}
-
static void mdock_window_class_init (MDockWindowClass *klass)
{
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
@@ -169,7 +164,6 @@ static void mdock_window_class_init (MDockWindowClass *klass)
obj_class->get_property = mdock_window_get_property;
obj_class->constructed = mdock_window_constructed;
obj_class->dispose = mdock_window_dispose;
- obj_class->finalize = mdock_window_finalize;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
widget_class->enter_notify_event = mdock_window_enter_notify;
widget_class->leave_notify_event = mdock_window_leave_notify;