aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
AgeCommit message (Collapse)AuthorFilesLines
2015-01-22Add -no-slit and -no-toolbar flagsMathias Gumz1-2/+1
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 Gumz2-13/+14
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-21Refactor: bundle related members togetherMathias Gumz2-220/+211
Also: try to avoid unsigned/signed problems in drawing code.
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-16Fix uncommited change (see 8387742c8...)Mathias Gumz1-1/+1
2015-01-16Fix casting issuesMathias Gumz1-2/+2
2015-01-16Fix uninitialized variables; cosmeticsMathias Gumz5-42/+22
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-16Reduce number of allocations for menu creationMathias Gumz2-7/+29
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 menu code: be more explicit and compactMathias Gumz2-133/+117
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-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-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-03Fix signature ITypeAheadable::isEnabled()Mathias Gumz1-1/+1
2015-01-03Fix signature FbTk::FontImp::rotate()Mathias Gumz1-1/+1
2015-01-03Clean unused variablesMathias Gumz4-7/+1
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 Gumz1-1/+0
Clang and Gcc-4.9 complaint about some unused variables here and there. And who are we to not make a compiler happy :)
2015-01-03Use correct buffer size for number2*()Mathias Gumz1-3/+6
2014-05-12allow a timeout of a full 'unit'Mathias Gumz1-1/+1
the -1 in the FbTk::FbTimer::remainingNext() function was pointless in the first place anyway: reducing the timeout by just 1 microsecond improves nothing (in this case). if the timer triggers exactly at a full unit (second) then it's correct to wait for the full next unit.
2014-05-12detect minute-based strftime-formats (again)Mathias Gumz2-3/+3
the lag / skipping of the clock was not caused by faulty timer code on fluxbox's side but by the behavior and inner workings of time(). since this is fixed now (913244789f) we can now rollback ec7fe513c8 and detect strftime-formats which need intervals of seconds or minutes. minor: the small change to FbTk::Timer::setTimeout() reduces one start() / stop() cycle for a running timer.
2014-04-11removed reference to 'defaults.hh'Mathias Gumz1-2/+0
2014-04-11merge Sami Kerola's new build-systemMathias Gumz24-180/+163
2014-02-18Fix race condition on shutdownMathias Gumz3-146/+1
This commit fixes primarily a race condition that occurs when xinit(1) shuts down: by not acting properly fluxbox gets caught in an infinite loop. It caused bug #1100. xinit(1) sends a SIGHUP signal to all processes. fluxbox tries to shutdown itself properly by shutting down workspaces and screens. While doing that, the Xserver might be gone already. Additionally, fluxbox used to restart() itself on SIGHUP, which is clearly not the right thing to do when xinit(1) is about to end the session. So, fluxbox does this: * handling SIGHUP now shuts down fluxbox without clearing workspaces and screens. * A 2 second alarm() is triggered in Fluxbox::shutdown() as a last resort * XSetIOErrorHandler() is used to recognize the disconnect from the xserver. * SIGUSR1 is for restarting fluxbox, SIGUSR2 for reloading the config * FbTk/SignalHandler.cc/hh is gone; this unused abstraction served currently no real purpose. Signal handling is now done in main.cc * Unrelated to the issue itself src/main.cc was trimmed down quite a bit and the code (responsible for handling the command line interface) was moved to src/cli*
2013-06-29fix detection of $HOME folderMathias Gumz1-5/+29
usually $HOME is set when fluxbox runs. in some rare scenarios (eg., fuzzying binaries to detect bugs) one could launch fluxbox by using 'env -i' and thus eliminating $HOME from the environment. to prevent crashes fluxbox uses now 'getpwuid()' when $HOME is not set to detect the home folder.
2013-06-22cosmeticsMathias Gumz2-9/+8
2013-06-18Speedup overlong text detectionMathias Gumz3-26/+70
Detecting very long window titles is done via FbTk::TextUtils::doAlignment(). Instead of removing one char from the title at a time to see if it fits into a given 'max_width', we now use a binary-search like approach to get faster to the right value. This massively improves the speed for windows with (arbitrary) long window titles (see bug #1090, javascript document.title = new Array(4999).join("."); leads to massive waiting for fluxbox to detect that this window has a very long title). In addition to that Xft returns 'wrapped' shorts ('integer overflows') for long texts: XGlpyhInfo.xOff is declared as signed short, it's able to hold ~32k pixels. A monospace font with font-size 10 produces an integer overflow after 3276 chars / glyphs, thus rendering the check if (text_width < max_width) { /* ... */ } pointless and leading rendering the whole title. By calculating some kind of upper limit for a pseudo-wide glyph ("WW") and strictly cutting off the input string at that limit prevents this issue.
2013-05-26build-sys: move to non-recursive buildSami Kerola2-76/+164
This rather large change will attempts to make 'make' to work better. See excellent paper 'Recursive Make Considered Harmful' by Peter Miller for further explanation why several make files is worse than one for whole project. Note. The tests are build with 'make check' rather than defining TEST. Reference: http://miller.emu.id.au/pmiller/books/rmch/ Reference: http://karelzak.blogspot.co.uk/2013/02/non-recursive-automake.html
2013-05-26build-sys: use pkg-config to locate dependenciesSami Kerola2-2/+4
This commit alters XRANDR (X Resize And Rotate) extension dependency, which is expected to have at least version 1.4. Earlier old versions of xrandr were supported, at least to some extent.
2013-05-26build-sys: use AC_USE_SYSTEM_EXTENSIONSSami Kerola7-33/+0
The earlier _GNU_SOURCE definitions possibly did not take effect everywhere where it was intended.
2013-05-26build-sys: include config.h to all files using automakeSami Kerola19-73/+1
Do not try to be too smart which compilations need config.h, as most of them will simply because of the config.h has information about system capabilities.
2013-02-13Initialize FbTk::Timer.m_timeout correctlyMathias Gumz1-2/+4
2013-02-10FbTk::FbTime::mono() yields microseconds since fluxbox startedMathias Gumz1-3/+2
2013-02-10CleanupMathias Gumz2-31/+31
2013-02-10More subtle brightening of texturesMathias Gumz1-5/+5
2013-02-06Fix bug in renderEllipticGradient()Mathias Gumz1-17/+20
For odd 'widths' and 'heigths' the texture would not be filled completely: Given a 'width' of 5 we would render only 4 instances of x (-2, 1, 0, 1) instead of the needed 5. This results in a texture which looks a bit cut off to the bottom right side.
2013-02-06Minor cosmeticsMathias Gumz1-38/+41
2013-02-06Fix integer overflowMathias Gumz1-1/+1
I forgot this piece in 779618e45d4571bb6a4866aa2e398780f4b4da5d.
2013-02-06Reduces memory footprintMathias Gumz1-7/+5
The buffer for some gradients does not have to be width * height big when two lines are sufficient.
2013-02-06Branchless code for interlacing a textureMathias Gumz1-25/+15
2013-02-06Fix integer overflow for bigger texturesMathias Gumz1-2/+6
2013-02-01Fix regression regarding timers with equal end-timeMathias Gumz1-2/+6
std::set<Key, Comp> stores Key only if Comp(Key) yields a unique result (My mistake: I was under the impression Comp is only used for the ordering). This prevents FbTk::Timers with equal end-times from actually being started. Escpecially in situation with multiple ClockTools this lead to stopped timers (see bug #3600694). Kudos to Adam Majer for enlightening discussions.
2013-01-31Adds 'ClientPatternTest' commandMathias Gumz2-1/+9
ClientPatterns might be tricky to get right. Instead of fiddling around in either the keys-file or the apps-file and restarting fluxbox to see if the changes had any effect / matched the right windows, 'ClientPatternTest' and the fluxbox-remote should make this easier: $> fluxbox-remote "clientpatterntest (title=.*vim*)" This causes fluxbox to store the list of matched windows in the _FLUXBOX_ACTION_RESULT property onto the rootwindow. This property might then be read by: $> xprop -root _FLUXBOX_ACTION_RESULT or $> fluxbox-remote result The format of the list is: win_id \t title_of_window \n win_id is '-1' when fluxbox wasn't able to parse the given ClientPattern. win_id is '0' when there are no windows matching the given ClientPattern.
2013-01-26Calculates timeouts of ClockTool based upon System ClockMathias Gumz3-18/+27
Users expect time switches to happen upon system clock times. Calculating the timeout for the next refresh of the shown time via the monotonic clock is wrong: The monotonic clock yields values based upon some arbitrary point in time which might be off a little bit to the system clock, a 'full' minute of the monotonic clock might be in the midst of a system clock minute.
2013-01-23Improve calculation of brighter colorsMathias Gumz4-22/+209
The old code did not brighten up "pure" colors like "red", "green" and "blue" at all. The new code use a different precomputed LUT which is based upon simplified vector math, see the comments in FbTk/ColorLUT.cc
2013-01-17Fix bug: actually invert a given TextureMathias Gumz1-1/+1
Stupid typo.