From ecdaab5edf619d3cdc7bba9856d5f92068c28c83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20L=C3=BCbking?= <thomas.luebking@gmail.com>
Date: Fri, 8 Jul 2016 00:07:39 +0200
Subject: fix titlebar ClickN handling

the tabcontainer is usually true and the releases were only
handled for the WINDOW context.

This relies on the patch to control OnTitlebar ./. OnWindow !

BUG: 1073
---
 src/Window.cc | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/Window.cc b/src/Window.cc
index a4f6341..56c78c7 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2460,11 +2460,15 @@ void FluxboxWindow::buttonReleaseEvent(XButtonEvent &re) {
         stopResizing();
     else if (m_attaching_tab)
         attachTo(re.x_root, re.y_root);
-    else if (!frame().tabcontainer().tryButtonReleaseEvent(re)) {
-
-        if (m_last_button_x == re.x_root && m_last_button_y == re.y_root) {
-            Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button, Keys::ON_WINDOW, &winClient(), re.time);
-        }
+    else if (m_last_button_x == re.x_root && m_last_button_y == re.y_root) {
+        int context = 0;
+        context = frame().getContext(re.subwindow ? re.subwindow : re.window,
+                                     re.x_root, re.y_root);
+        if (!context && re.subwindow)
+            context = frame().getContext(re.window);
+
+        Fluxbox::instance()->keys()->doAction(re.type, re.state, re.button,
+                                              context, &winClient(), re.time);
     }
 }
 
-- 
cgit v0.11.2