summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/Window.cc8
-rw-r--r--src/WindowCmd.cc1
-rw-r--r--src/WindowCmd.hh15
-rw-r--r--src/Workspace.cc2
5 files changed, 27 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4976b30..201a575 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/02/06:
4 * Make selecting `close' from the workspace menu close the correct client,
5 rather than the active tab in the window -- selecting `close' from right
6 clicking on a tab is still wrong, as there are complications (Mark)
7 WindowCmd.cc/hh Window.cc Workspace.cc
3*07/02/05: 8*07/02/05:
4 * Made some changes to the way autogrouping in the apps file works (Mark) 9 * Made some changes to the way autogrouping in the apps file works (Mark)
5 - Introduced new syntax [group] (workspace) to group new windows only with 10 - Introduced new syntax [group] (workspace) to group new windows only with
diff --git a/src/Window.cc b/src/Window.cc
index 1b3ef2f..c505edc 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3870,12 +3870,16 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) {
3870 3870
3871 3871
3872void FluxboxWindow::close() { 3872void FluxboxWindow::close() {
3873 if (m_client) 3873 if (WindowCmd<void>::window() == this && WindowCmd<void>::client())
3874 WindowCmd<void>::client()->sendClose(false);
3875 else if (m_client)
3874 m_client->sendClose(false); 3876 m_client->sendClose(false);
3875} 3877}
3876 3878
3877void FluxboxWindow::kill() { 3879void FluxboxWindow::kill() {
3878 if (m_client) 3880 if (WindowCmd<void>::window() == this && WindowCmd<void>::client())
3881 WindowCmd<void>::client()->sendClose(true);
3882 else if (m_client)
3879 m_client->sendClose(true); 3883 m_client->sendClose(true);
3880} 3884}
3881 3885
diff --git a/src/WindowCmd.cc b/src/WindowCmd.cc
index 7a9c8f0..231e1a4 100644
--- a/src/WindowCmd.cc
+++ b/src/WindowCmd.cc
@@ -24,3 +24,4 @@
24#include "WindowCmd.hh" 24#include "WindowCmd.hh"
25 25
26FluxboxWindow *WindowCmd_base::s_win = 0; 26FluxboxWindow *WindowCmd_base::s_win = 0;
27WinClient *WindowCmd_base::s_client = 0;
diff --git a/src/WindowCmd.hh b/src/WindowCmd.hh
index 5eca723..17a4e86 100644
--- a/src/WindowCmd.hh
+++ b/src/WindowCmd.hh
@@ -26,14 +26,27 @@
26 26
27#include "FbTk/Command.hh" 27#include "FbTk/Command.hh"
28#include "Window.hh" 28#include "Window.hh"
29#include "WinClient.hh"
29 30
30/// holds context for WindowCmd 31/// holds context for WindowCmd
31class WindowCmd_base { 32class WindowCmd_base {
32public: 33public:
33 static void setWindow(FluxboxWindow *win) { s_win = win; } 34 // some window commands (e.g. close, kill, detach) need to know which client
35 // the command refers to, so we store it here as well, in case it is not the
36 // current client (selected from workspace menu, for example)
37 static void setWindow(FluxboxWindow *win) {
38 s_win = win;
39 s_client = (win ? &win->winClient() : 0);
40 }
41 static void setClient(WinClient *client) {
42 s_client = client;
43 s_win = (client ? client->fbwindow() : 0);
44 }
34 static FluxboxWindow *window() { return s_win; } 45 static FluxboxWindow *window() { return s_win; }
46 static WinClient *client() { return s_client; }
35protected: 47protected:
36 static FluxboxWindow *s_win; 48 static FluxboxWindow *s_win;
49 static WinClient *s_client;
37}; 50};
38 51
39 52
diff --git a/src/Workspace.cc b/src/Workspace.cc
index caeb662..4b367ac 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -102,7 +102,7 @@ public:
102 const FbTk::Menu *submenu() const { return &m_client.screen().windowMenu(); } 102 const FbTk::Menu *submenu() const { return &m_client.screen().windowMenu(); }
103 103
104 void showSubmenu() { 104 void showSubmenu() {
105 WindowCmd<void>::setWindow(m_client.fbwindow()); 105 WindowCmd<void>::setClient(&m_client);
106 FbTk::MenuItem::showSubmenu(); 106 FbTk::MenuItem::showSubmenu();
107 } 107 }
108 108