Improve mouse button detection for mouse release events
[quassel.git] / src / qtui / chatscene.cpp
index f83cfe8..60f3f1b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel Project                          *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -587,6 +587,9 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) {
   ChatItem *item = chatItemAt(pos);
   if(item)
     item->addActionsToMenu(&menu, item->mapFromScene(pos));
+  else
+    // no item -> default scene actions
+    Client::mainUi()->actionProvider()->addActions(&menu, filter(), BufferId());
 
   menu.exec(event->screenPos());
 
@@ -650,7 +653,7 @@ void ChatScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
 }
 
 void ChatScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
-  if(!event->buttons() & Qt::LeftButton) {
+  if(event->button() == Qt::LeftButton && _leftButtonPressed) {
     _leftButtonPressed = false;
     if(_clickMode != NoClick) {
       if(_clickMode == SingleClick)