aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-18 15:27:21 (GMT)
committerfluxgen <fluxgen>2003-12-18 15:27:21 (GMT)
commit8735c6a08bdab11172ec6e4c35271a4b8c374fc7 (patch)
tree07d2234b862cd80fe6699ac6fe354cba7c494892
parentf6628881d214d0216fa43e31d644f956e4d9f373 (diff)
downloadfluxbox_pavel-8735c6a08bdab11172ec6e4c35271a4b8c374fc7.zip
fluxbox_pavel-8735c6a08bdab11172ec6e4c35271a4b8c374fc7.tar.bz2
clamp menu delay resource
-rw-r--r--src/Screen.cc53
1 files changed, 39 insertions, 14 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index d579e62..474c334 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.249 2003/12/14 01:09:00 fluxgen Exp $ 25// $Id: Screen.cc,v 1.250 2003/12/18 15:27:21 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -335,6 +335,17 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
335 335
336 m_menutheme->setAlpha(*resource.menu_alpha); 336 m_menutheme->setAlpha(*resource.menu_alpha);
337 m_menutheme->setMenuMode(*resource.menu_mode); 337 m_menutheme->setMenuMode(*resource.menu_mode);
338 // clamp values
339 if (*resource.menu_delay > 5000)
340 *resource.menu_delay = 5000;
341 if (*resource.menu_delay < 0)
342 *resource.menu_delay = 0;
343
344 if (*resource.menu_delay_close > 5000)
345 *resource.menu_delay_close = 5000;
346 if (*resource.menu_delay_close < 0)
347 *resource.menu_delay_close = 0;
348
338 m_menutheme->setDelayOpen(*resource.menu_delay); 349 m_menutheme->setDelayOpen(*resource.menu_delay);
339 m_menutheme->setDelayClose(*resource.menu_delay_close); 350 m_menutheme->setDelayClose(*resource.menu_delay_close);
340 351
@@ -601,6 +612,18 @@ FbTk::Menu *BScreen::createMenu(const std::string &label) {
601void BScreen::reconfigure() { 612void BScreen::reconfigure() {
602 m_menutheme->setAlpha(*resource.menu_alpha); 613 m_menutheme->setAlpha(*resource.menu_alpha);
603 m_menutheme->setMenuMode(*resource.menu_mode); 614 m_menutheme->setMenuMode(*resource.menu_mode);
615
616 // clamp values
617 if (*resource.menu_delay > 5000)
618 *resource.menu_delay = 5000;
619 if (*resource.menu_delay < 0)
620 *resource.menu_delay = 0;
621
622 if (*resource.menu_delay_close > 5000)
623 *resource.menu_delay_close = 5000;
624 if (*resource.menu_delay_close < 0)
625 *resource.menu_delay_close = 0;
626
604 m_menutheme->setDelayOpen(*resource.menu_delay); 627 m_menutheme->setDelayOpen(*resource.menu_delay);
605 m_menutheme->setDelayClose(*resource.menu_delay_close); 628 m_menutheme->setDelayClose(*resource.menu_delay_close);
606 629
@@ -878,10 +901,11 @@ void BScreen::changeWorkspaceID(unsigned int id) {
878 // This is a little tricks to reduce flicker 901 // This is a little tricks to reduce flicker
879 // this way we can set focus pixmap on frame before we show it 902 // this way we can set focus pixmap on frame before we show it
880 // and using ExposeEvent to redraw without flicker 903 // and using ExposeEvent to redraw without flicker
881 //WinClient *win = getLastFocusedWindow(currentWorkspaceID()); 904 /*
882 //if (win && win->fbwindow()) { 905 WinClient *win = getLastFocusedWindow(currentWorkspaceID());
883 // win->fbwindow()->setFocusFlag(true); 906 if (win && win->fbwindow())
884 //} 907 win->fbwindow()->setFocusFlag(true);
908 */
885 909
886 currentWorkspace()->showAll(); 910 currentWorkspace()->showAll();
887 911
@@ -899,9 +923,8 @@ void BScreen::changeWorkspaceID(unsigned int id) {
899 923
900 924
901void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS) { 925void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS) {
902 if (! m_current_workspace || id >= m_workspaces_list.size()) { 926 if (! m_current_workspace || id >= m_workspaces_list.size())
903 return; 927 return;
904 }
905 928
906 if (!win) { 929 if (!win) {
907 WinClient *client = Fluxbox::instance()->getFocusedWindow(); 930 WinClient *client = Fluxbox::instance()->getFocusedWindow();
@@ -915,16 +938,17 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
915 if (win && &win->screen() == this && 938 if (win && &win->screen() == this &&
916 (! win->isStuck())) { 939 (! win->isStuck())) {
917 940
918 if (win->isIconic()) { 941 // if iconified, deiconify it before we send it somewhere
942 if (win->isIconic())
919 win->deiconify(); 943 win->deiconify();
920 }
921 944
945 // if the window isn't on current workspace, hide it
922 if (id != currentWorkspace()->workspaceID()) 946 if (id != currentWorkspace()->workspaceID())
923 win->withdraw(); 947 win->withdraw();
924 948
925
926 reassociateWindow(win, id, true); 949 reassociateWindow(win, id, true);
927 950
951 // if the window is on current workspace, show it.
928 if (id == currentWorkspace()->workspaceID()) 952 if (id == currentWorkspace()->workspaceID())
929 win->deiconify(false, false); 953 win->deiconify(false, false);
930 954
@@ -2255,7 +2279,7 @@ WinClient *BScreen::getLastFocusedWindow(int workspace) {
2255 2279
2256 FocusedWindows::iterator it = focused_list.begin(); 2280 FocusedWindows::iterator it = focused_list.begin();
2257 FocusedWindows::iterator it_end = focused_list.end(); 2281 FocusedWindows::iterator it_end = focused_list.end();
2258 for (; it != it_end; ++it) 2282 for (; it != it_end; ++it) {
2259 if ((*it)->fbwindow() && 2283 if ((*it)->fbwindow() &&
2260 (((int)(*it)->fbwindow()->workspaceNumber()) == workspace 2284 (((int)(*it)->fbwindow()->workspaceNumber()) == workspace
2261 && !(*it)->fbwindow()->isIconic() 2285 && !(*it)->fbwindow()->isIconic()
@@ -2263,17 +2287,18 @@ WinClient *BScreen::getLastFocusedWindow(int workspace) {
2263 // only give focus to a stuck window if it is currently focused 2287 // only give focus to a stuck window if it is currently focused
2264 // otherwise they tend to override normal workspace focus 2288 // otherwise they tend to override normal workspace focus
2265 return *it; 2289 return *it;
2290 }
2266 return 0; 2291 return 0;
2267} 2292}
2268 2293
2269void BScreen::updateSize() { 2294void BScreen::updateSize() {
2295 // force update geometry
2270 rootWindow().updateGeometry(); 2296 rootWindow().updateGeometry();
2271 2297
2272 // reconfigure anything that depends on root window size
2273
2274 // reset background 2298 // reset background
2275 m_root_theme->reconfigTheme(); 2299 m_root_theme->reconfigTheme();
2276 2300
2301 // send resize notify
2277 m_resize_sig.notify(); 2302 m_resize_sig.notify();
2278} 2303}
2279 2304