aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-01-24CleanupMathias Gumz2-60/+62
2015-01-24Improve code documentationMathias Gumz2-16/+24
'width' might imply something 'aligned horizontally'. The first parameter of maxTextLength() is given in pixels. To avoid confusion, the name of the parameter is changed. The comment before the binary search reflects better why and what we need to do.
2015-01-24Fix text rendering in rotated TextButtonsMathias Gumz1-5/+12
A vertically rotated text should be checked against the height of the button, not the width of it. Fixes #1119 ("Toolbar cannot display full text of workspace/​clock/​window title.")
2015-01-23Refactor Toolbar.cc, less noiseMathias Gumz1-148/+80
2015-01-23Refactor FbWinFrameMathias Gumz2-519/+321
FbWinFrame is now simpler to read due to less overall noise.
2015-01-23CosmeticMathias Gumz3-12/+5
2015-01-22Add -no-slit and -no-toolbar flagsMathias Gumz6-260/+265
Sometimes fluxbox is used as a component of a desktop environment ( e.g., the "Lumina Desktop"). It's easier and more stable for this kind of "users" to disable the toolbar or the slit alltogether. Why not configure these features out? Because then they would need 2 installations of fluxbox: One without the slit and the toolbar (and perhaps other components) and one with them. This implements feature request #314, at least partially. This commit also looks bigger than it actually is: I refactored and cleaned up classes Fluxbox and BScreen.
2015-01-22Remove 'always true' conditionMathias Gumz1-1/+1
2015-01-22Fix broken _NET_REQUEST_FRAME_EXTENTS supportMathias Gumz3-14/+20
There was a subtle flaw in the way fluxbox detects to which BScreen a given Window belongs: We have to compare the RootWindow of the given Window against the RootWindow of each BScreen. That underlying flaw made _NET_REQUEST_FRAME_EXTENTS fail: the code path needs a valid BScreen for the given window, otherwise we return early. Closes #1121.
2015-01-22Fix removing windows from icon listMathias Gumz1-3/+3
std::remove_if() removes an item from a container and returns a past-the-end iterator ... which equals m_icon_list.end(). As a result the check if (erase_it != m_icon_list.end()) { iconList().erase(erase_it); iconListSig().emit(*this); } will never succeed and thus the iconListSig() will never be emitted.
2015-01-22CosmeticMathias Gumz4-45/+12
2015-01-21CosmeticMathias Gumz2-5/+14
2015-01-21Fix segfault on shutdownMathias Gumz5-61/+29
There was a problem deep within how the menus were connected and when and what gets deleted. It was clearly related to a menu which was kind of global. In order to better understand the code flow I eliminated the ExtraMenu code: it was used only to get the Remember-Menu into the Window-Menu. Instead of having a singleton of the Remember-Menu and fight against the shaky interconnections we just create a new one on demand and delete when the menu gets deleted. Looks like this fixes the problem. The menu code needs more love anyway. Closes #1118
2015-01-21Refactor: bundle related members togetherMathias Gumz2-220/+211
Also: try to avoid unsigned/signed problems in drawing code.
2015-01-21Cosmetic: less code bloatMathias Gumz1-69/+57
2015-01-21Fix potential memory leakMathias Gumz1-11/+3
If allocation of I2 does not succeed, we need to free I1. Closes #1120
2015-01-21Fix behavior for autorepeat keysMathias Gumz2-2/+13
This reverts 58e09b719077605efadac9b712acb8f5e752f732 after having regressions and bug reports in regards to autorepeated key events are not working anymore. So, the problem with the lost keypress after the workspace change is still open but at least the behavior for other folks is as it was. Since 58e09b7190 seems to be corelated to "auto repeat" keys it might indicate the problem which 58e09b7190 "fixed". We will see. Fixes #1115.
2015-01-21Minor cosmeticsMathias Gumz2-9/+8
2015-01-21Fix compile errors with clangMathias Gumz2-6/+4
2015-01-21Remove unused variableMathias Gumz1-1/+1
2015-01-19Fix compile error: old g++ does not like c-like struct initializationMathias Gumz1-5/+4
2015-01-16Fix uncommited change (see 8387742c8...)Mathias Gumz1-1/+1
2015-01-16Fix casting issuesMathias Gumz1-2/+2
2015-01-16Fix uninitialized variables; cosmeticsMathias Gumz8-77/+36
Note: I expect only modern compilers will hit the source of fluxbox. It seems futile to guard stdlib headers while demanding <algorithm> etc. This should trim down the noise in the source quite a bit.
2015-01-16Avoid modulo 0Mathias Gumz1-0/+4
Coverity pointed out that 'size' might be 0 (even if the 'find()' would detect this). This commit fixes this and avoids entering 'find()' at all.
2015-01-16Fix semantic errors (wrong variable names etc)Mathias Gumz2-2/+3
Uncovered by coverity-scan.
2015-01-16Fix leak in ClientPatternTestCmdMathias Gumz1-21/+13
Coverity-scan points to the leaking ClientPattern. The rest is just cosmetics.
2015-01-16Refactor: bundle xinerama-info together, simpler codeMathias Gumz2-61/+52
Part of this massive looking but simple rather simple change is a the way we check for active Xinerama: XineramaIsActive() was used before. The docs for XineramaQueryScreens() state that XineramaQueryScreens() returns NULL and sets number to 0 if Xinerama is not active. Sold.
2015-01-16Refactor: move some menu-creation functions to MenuCreatorMathias Gumz7-65/+48
Another patch to trim down the code that needs to be part of BScreen
2015-01-16Reduce number of allocations for menu creationMathias Gumz4-23/+44
Every time either the Slit menu or the Toolbar menu were added to the root menu, the whole root menu was (re)created from scratch. Now we create and remove only the menus needed. Side effect: the position of these menus is now at the end of the root menu and not somewhere in between. If users complaint, I' ll think about it.
2015-01-15Refactor: split out menu generation from BScreenMathias Gumz7-381/+572
Again, it's easier to read the code when the whole menu-generation is out of the way.
2015-01-15Refactor menu code: be more explicit and compactMathias Gumz15-408/+375
This commit is a preparation step for some menu cleanup ahead. To make it easier to understand which types of MenuItems are added where and when, I converted the overloaded FbTk::Menu::insert() functions into explicit ones (Menu::insertSubmenu(), Menu::insertItem(), etc. ). This makes it possible to just grep for 'insertSubmenu()'. Side effect this commit: it trims down the very verbose creation of menu items in regards to how the labels are created. Minor: FbTk::Menu::shown and FbTk::Menu::s_focused are moved out of the class.
2015-01-10Code cleanupMathias Gumz3-53/+20
Reorder some includes; remove unused includes
2015-01-10Make use of API instead of hardcoded default fontMathias Gumz1-4/+3
2015-01-10Fix order of reconfigure the theme of an IconButtonMathias Gumz1-15/+11
The font might have an impact to the result of width() and height(). In order to render the new pixmap correctly fluxbox now first sets the font and the width of the border and after that it recreates the pixmap.
2015-01-10Remove dead codeMathias Gumz2-20/+0
2015-01-10Fix bug: integer underflow in startup phaseMathias Gumz1-1/+7
When fluxbox comes up some of it's drawables span a 1x1 area. Subtracting from such small numbers bigger ones always lead to massive problems when 'unsigned int' are involved: 'button_width' is an unsigned int of '1' (this might be caused by another issue or on purpose, anyway), subtracting -10 or any other number should result in something < 0 when in reality an integer underflow happen: max_width is now MAX_INT-something big. This makes fluxbox crash under certain circumstances. This fixes bug #1116.
2015-01-05Fix 'make check'Release-1_3_6Mathias Gumz1-21/+10
2015-01-05Fix build-system: install data files (keys, apps, menu ...)Mathias Gumz1-7/+3
* Correctly build data files when operate outside of the $(srcdir) * Actually install data files * Use pkg-config to detect X11, works better on MacOSX. We used pkg-config already anyway, double checking for X11 does not yield better results. * Replace EXEEXT in some files while before installing them
2015-01-04Fix build-system: use xxx_LDADD instead of xxx_LDFLAGSMathias Gumz1-4/+6
xxx_LDFLAGS place the libraries like '-lX11' or '-lXft' at the beginning of the linker command. Some systems were not able to handle the situation and this lead to a lot of unresolved symbols. Reading the documentation of automake: ... you can use LDADD to do so. This variable is used to specify additional objects or libraries to link with; it is inappropriate for specifying specific linker flags, you should use AM_LDFLAGS for this purpose. In addition we link against -lm in order to satisfy symbols refering to 'cos' and 'sin'.
2015-01-03Fix to make clang happyNable 801-3/+5
POSIX states that 'd_name' in 'struct dirent' is char[], so it cannot be NULL. This will result in the compiler complainting about an expression which always evaluates to true ... for this compiler (clang). But in some implementations 'd_name' is a 'char*' that's why it's better to keep the check for possible NULL.
2015-01-03Minor API change for OSDWindowMathias Gumz4-10/+9
OSDWindow::resize(const FbTk::BiDiString&) shadowed FbWindow::resize(x, y). To fix this I renamed the function to OSDWindow::resizeForText() to make the intention clear.
2015-01-03Fix signature ITypeAheadable::isEnabled()Mathias Gumz1-1/+1
2015-01-03Fix signature FbTk::FontImp::rotate()Mathias Gumz1-1/+1
2015-01-03Clean unused variablesMathias Gumz6-9/+1
2015-01-03Fix clang warning 'expression with side effects'Mathias Gumz2-9/+14
2015-01-03Fix number2*() functionsMathias Gumz1-7/+7
As correctly pointed out by 'Nable80': "%llx" does not create the 0x prefix for the hex-string. In addition to that: snprintf() adds a terminating \0.
2015-01-03Remove dead / unused codeMathias Gumz2-78/+5
Again: Compiler happy, we are happy.
2015-01-03Fix typo / editor bug or something like that.Mathias Gumz1-1/+1
While running code analysis tools this issue popped up. As it is written it is clearly a NOP, but the reason for why it is written that way remains unknown. I suspect that it was a textfragment introduced by some repeat-function of the used editor (think '.' in VIM). The code was introduced by commit a932a7a801 and looked like this in the original form: if(!XQueryTree(FbTk::App::instance()->display(), window().window(), &root_return, &parent_return, &children_return, &nchildren_return)) parent_return=parent_return;//return; Look at the outcommented return statement. I decided to return from that function instead of the NOP.
2015-01-03Remove various unused variablesMathias Gumz7-28/+21
Clang and Gcc-4.9 complaint about some unused variables here and there. And who are we to not make a compiler happy :)