aboutsummaryrefslogtreecommitdiff
path: root/src/Rootmenu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rootmenu.cc')
-rw-r--r--src/Rootmenu.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/Rootmenu.cc b/src/Rootmenu.cc
index 5339630..66df012 100644
--- a/src/Rootmenu.cc
+++ b/src/Rootmenu.cc
@@ -50,7 +50,10 @@
50#endif // MAXPATHLEN 50#endif // MAXPATHLEN
51 51
52 52
53Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) { 53Rootmenu::Rootmenu(BScreen *scrn)
54: Basemenu(scrn),
55 auto_group_window(0)
56{
54 screen = scrn; 57 screen = scrn;
55} 58}
56 59
@@ -73,7 +76,10 @@ void Rootmenu::itemSelected(int button, unsigned int index) {
73 sprintf(displaystring + strlen(displaystring) - 1, "%d", 76 sprintf(displaystring + strlen(displaystring) - 1, "%d",
74 screen->getScreenNumber()); 77 screen->getScreenNumber());
75 78
79 screen->setAutoGroupWindow(useAutoGroupWindow());
80
76 bexec(item->exec().c_str(), displaystring); 81 bexec(item->exec().c_str(), displaystring);
82
77 #else // __EMX__ 83 #else // __EMX__
78 spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL); 84 spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL);
79 #endif // !__EMX__ 85 #endif // !__EMX__
@@ -113,3 +119,22 @@ void Rootmenu::itemSelected(int button, unsigned int index) {
113 } 119 }
114} 120}
115 121
122void Rootmenu::setAutoGroupWindow(Window window)
123{
124 auto_group_window = window;
125}
126
127Window Rootmenu::useAutoGroupWindow()
128{
129 // Return and clear the auto-grouping state.
130 Window w = auto_group_window;
131 if (w)
132 auto_group_window = 0; // clear it immediately
133 // If not set check the parent and the parent's parent, ...
134 else {
135 Rootmenu* parent = dynamic_cast<Rootmenu*>(GetParent());
136 if (parent)
137 w = parent->useAutoGroupWindow();
138 }
139 return w;
140}