aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
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 :)
2015-01-03Update copyright infoMathias Gumz1-1/+1
2015-01-03Use correct buffer size for number2*()Mathias Gumz1-3/+6
2015-01-03Fix build issueMathias Gumz1-1/+1
2015-01-03Remove reference to src/tests/testSignalMathias Gumz1-13/+0
2015-01-03Update release versionMathias Gumz2-1/+5
2014-10-27make use of FbTk-apiMathias Gumz1-27/+26
2014-09-29treat windows having WM_CLASS == "DockApp" like DockAppsMathias Gumz2-5/+13
this commit implements feature-request #317: "Add support for GTK dockapps.": "Back in 2010, WindowMaker implemented a system where windows with WM_CLASS res_class = DockApp would be treated as if they had initial_state = WithdrawnState, since GTK refuses to allow this."
2014-09-29Corrections for border width for relative resizeArkadiusz Bokowy1-0/+2
2014-09-14Code cleanupArkadiusz Bokowy1-3/+1
File name expansion is done internally by the Slit::loadClientList, so there is no need to duplicate the code.
2014-09-14fix: check the correct XClassHint propertyMathias Gumz1-8/+3
kudos to Arkadiusz Bokowy (this commit is a slightly changed version of a patch sent to the devel-ml): when retrieving the '.res_name' of a XClassHint we should check '.res_name' and not '.res_class'. the other changes only reduce the code.
2014-07-22fix uninitialized variablesMathias Gumz2-4/+2
2014-07-22fix _NET_MOVERESIZE_WINDOW resize issue (#1108)Mathias Gumz1-6/+6
handing over the dimensions of a WinClient client must not contain properties of the FbWinFrame, otherwise they get added twice in FbWinFrame::moveResizeForClient() and thus result in a resizes when no resize is wanted. other changes: it's easier for me to detect the nth bit when the value looks like (1 << 8) instead of 0x0100 (for the 8th bit). that is why i changed 0x0100, 0x0200 etc. in the nearby code.
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-12cosmetic, less codeMathias Gumz1-9/+10
2014-05-12detect minute-based strftime-formats (again)Mathias Gumz3-6/+14
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-05-12fix clocktool lagging behind and skipping secondsMathias Gumz1-2/+13
from time to time (...) time() might be off to gettimeofday() by a second. the reason for this is that time() is usually implemented by just returning the field 'second' of the struct that represents the clock inside the kernel. gettimeofday() on the other hand also takes the 'fraction' field (mostly 'nanoseconds') into account and thus is closer to the current time than time(). the result of using time() was a perceived 'lag', sometimes the clocktool even skipped a second. by using FbTk::FbTime()::system() instead fixes the issue.
2014-04-11removed reference to 'defaults.hh'Mathias Gumz1-2/+0
2014-04-11merge Sami Kerola's new build-systemMathias Gumz47-504/+561
2014-04-09use function fluxbox::findScreen()Mathias Gumz1-9/+1
2014-04-09fix excessive loading of keys file caused by xmodmapMathias Gumz2-11/+43
xmodmap (and other tools) trigger MappingNotify events. a single xmodmap expression such as "keycode comma = comma semicolon" might trigger 4 or 5 MappingNotify events. loading the keys file on each of them is quite unefficient. fluxbox now uses a (250ms) timer which is reset upon further events.
2014-02-19make sure that result of division is signed intAmadeusz Sławiński1-4/+6
there is problem that x/y ended with unsigned int value due to width()/height() and negative result of division ended up being big it causes Focus to move window due to screen boundary checks fixes annoying behaviour of window moving few pixels with Mod4 KP_8 :MacroCmd {ResizeTo 100% 50%} {MoveTo 0 0 Top} {Raise} {Focus}
2014-02-18Fix race condition on shutdownMathias Gumz15-870/+698
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*
2014-02-17update of copyright infoMathias Gumz1-1/+1
2013-08-02Fix ArrangeWindowsStack* for multi-head displaysMathias Gumz1-62/+67
* Fix integer wrap around for some situations (resulting in a very wide window): w = max_width - x_offs - (*closest)->widthOffset() If the given window is on the right most display and thus 'x_offs' is bigger than 'max_width' (half of the display width), the resulting 'w' wraps around and becomes very large. * Place a single window via ArrangeWindowsStack* as well * Some minor code styling / reordering along the way
2013-08-02Add support for stacked tiling via ArrangeWindows*John Sennesael2-17/+107
2013-08-02Fix lost keypresses after workspace change (#1067)Ed Martin2-11/+2
Do not Ungrab the keyboard for a KeyPress event, this causes us to lose the KeyRelease event which is needed to ungrab the keyboard after the event happened.
2013-07-03Constify the type passed to std::equal_to.Raphael Kubo da Costa1-1/+1
std::bind2nd() has problems with the existing call because it uses the argument type passed to std::equal_to() in std::binder2nd()'s constructor, but WinClient* does not have the const specifier that `client' does. The call works fine with libstdc++ because of the way it implements std::bind2nd(), but fails with libc++ and possibly with other STL implementations as well.
2013-06-29fix detection of $HOME folderMathias Gumz3-17/+43
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 Kerola6-307/+538
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 Kerola5-12/+38
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 Kerola18-86/+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 Kerola36-133/+3
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-05-23more compact codeMathias Gumz1-19/+12
2013-05-23Use shared code, minor code simplificationMathias Gumz2-14/+19