From e1359adfd064d12bbf2bfb899ee99f07c2c7c712 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sun, 1 Feb 2015 08:07:26 +0100 Subject: Cosmetic --- NEWS | 2 +- src/Resources.cc | 8 +------- src/Screen.cc | 8 +++++--- src/ScreenResource.cc | 6 +++--- src/Window.cc | 25 +++++++++++++++---------- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index d17cf63..e1e7df4 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,7 @@ Minor Bugfixes: * working autorepeat keys * working vertical rotated Tabs and Toolbar -Featuere: +Features: * The improved TypeAhead sytem is not limited to matches on beginning of menu items anymore, it matches everywhere. * Minor tweaks to the i18n system diff --git a/src/Resources.cc b/src/Resources.cc index 128eedd..affaf19 100644 --- a/src/Resources.cc +++ b/src/Resources.cc @@ -26,17 +26,11 @@ #include "WinButton.hh" #include "fluxbox.hh" - #include "Layer.hh" -#include #include #include -#ifdef HAVE_CSTRING - #include -#else - #include -#endif +#include using std::string; using std::vector; diff --git a/src/Screen.cc b/src/Screen.cc index da4e719..2b5411d 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1290,9 +1290,11 @@ void BScreen::rereadMenu() { } const std::string BScreen::windowMenuFilename() const { - if ((*resource.windowmenufile).empty()) - return Fluxbox::instance()->getDefaultDataFilename("windowmenu"); - return *resource.windowmenufile; + std::string name = *resource.windowmenufile; + if (name.empty()) { + name = Fluxbox::instance()->getDefaultDataFilename("windowmenu"); + } + return name; } void BScreen::rereadWindowMenu() { diff --git a/src/ScreenResource.cc b/src/ScreenResource.cc index ade8416..0d8aaf7 100644 --- a/src/ScreenResource.cc +++ b/src/ScreenResource.cc @@ -79,9 +79,9 @@ setFromString(const char *strval) { -ScreenResource::ScreenResource(FbTk::ResourceManager &rm, - const std::string &scrname, - const std::string &altscrname): +ScreenResource::ScreenResource(FbTk::ResourceManager& rm, + const std::string& scrname, + const std::string& altscrname): opaque_move(rm, true, scrname + ".opaqueMove", altscrname+".OpaqueMove"), full_max(rm, false, scrname+".fullMaximization", altscrname+".FullMaximization"), max_ignore_inc(rm, true, scrname+".maxIgnoreIncrement", altscrname+".MaxIgnoreIncrement"), diff --git a/src/Window.cc b/src/Window.cc index daea663..9923a45 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -299,7 +299,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client): // add the window to the focus list // always add to front on startup to keep the focus order the same - if (m_focused || Fluxbox::instance()->isStartup()) + if (isFocused() || Fluxbox::instance()->isStartup()) screen().focusControl().addFocusWinFront(*this); else screen().focusControl().addFocusWinBack(*this); @@ -599,8 +599,8 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) { delete old_win; } else { // client.fbwindow() == 0 - associateClient(client); + associateClient(client); moveResizeClient(client); // right now, this block only happens with new windows or on restart @@ -2390,10 +2390,13 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { // undraw rectangle before warping workspaces if (!screen().doOpaqueMove()) { - parent().drawRectangle(screen().rootTheme()->opGC(), - m_last_move_x, m_last_move_y, - frame().width() + 2*frame().window().borderWidth()-1, - frame().height() + 2*frame().window().borderWidth()-1); + int bw = static_cast(frame().window().borderWidth()); + int w = static_cast(frame().width()) + 2*bw -1; + int h = static_cast(frame().height()) + 2*bw - 1; + if (w > 0 && h > 0) { + parent().drawRectangle(screen().rootTheme()->opGC(), + m_last_move_x, m_last_move_y, w, h); + } } if (moved_x && screen().isWorkspaceWarping()) { @@ -2444,10 +2447,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { // do not update display if another motion event is already pending if (!screen().doOpaqueMove()) { - parent().drawRectangle(screen().rootTheme()->opGC(), - dx, dy, - frame().width() + 2*frame().window().borderWidth()-1, - frame().height() + 2*frame().window().borderWidth()-1); + int bw = frame().window().borderWidth(); + int w = static_cast(frame().width()) + 2*bw - 1; + int h = static_cast(frame().height()) + 2*bw - 1; + if (w > 0 && h > 0) { + parent().drawRectangle(screen().rootTheme()->opGC(), dx, dy, w, h); + } m_last_move_x = dx; m_last_move_y = dy; } else { -- cgit v0.11.2