aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
AgeCommit message (Collapse)AuthorFilesLines
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.
2013-01-15Simplifies and fix bugs in FbTk::TimerMathias Gumz2-41/+36
* Calling Timer::setTimeout() from within Timer::start() might lead to ugly behavior (as experienced in bugs #3590078, #3600143, etc; see commit 4d307dcd10af9d817ff5c05fc40ae7487564cb31, fixes the problem partially). * Stop a timer first, then call the handler (via Timer::fireTimeout()). A given handler might call Timer::start() again, which (re)adds the Timer to the control list .. the following Timer::stop() would remove it again. * Use 'm_start' as indicator if timer is running. * Move the (now quite short) code of ::addTimer / ::removeTimer into the Timer::start() and Timer::stop() functions.
2013-01-13Ensure textures have the correct size bevor applying 'bevel'Mathias Gumz1-7/+8
2013-01-13Optimize inner loop of pixel transfer in TrueColorMathias Gumz1-65/+61
Testing bits-per-pixel in the inner loop is suboptimal, especially since that value does not change. A little helper macro helps to keep the code readable, also improves the situation for StaticGray and PseudoColor.
2013-01-13Use the same lookup-tables for solid and gradient texturesMathias Gumz5-164/+237
2013-01-13improved code documentationMathias Gumz2-14/+3
2013-01-13Minor optimization of handling the timersMathias Gumz1-15/+15
2013-01-12Fix bug: handle the list of Timers not in-placeMathias Gumz1-14/+18
With commit 541c8c4 we switched from an (manually) ordered list to a std::set<> to handle the active timers. The code which checks for overdue timers now traverses and modifies the std::set<> in place. This might lead to an infinite loop. Examples of such bad behavior are "flickering of the tooltip" (bug #3590078) or crashes (bug #3600143) or just insanely high cpu load when autoraising windows or submenus. We now make a copy of the std::set<> traverse this instead of the original.
2013-01-02Compile fix: forgotten parentheses around valueMathias Gumz1-1/+1
2012-12-30replace XKeycodeToKeysym() with XkbKeycodeToKeysym()Sami Kerola1-2/+3
The XKeycodeToKeysym() is deprecated. References: http://comments.gmane.org/gmane.comp.misc.suckless/9403
2012-12-30Fix double text rendering if using parentRelativeVladimir A. Pavlov1-2/+0
2012-12-30Set WM_WINDOW_ROLE for fluxbox windowsVladimir A. Pavlov2-0/+9
2012-12-11Fixed bug: use expanded style/theme filenameMathias Gumz1-1/+2
'filename' might contain a '~' which has to be expanded to work for regular system calls. We expanded 'filename' already but then did not use it. Fixes bug #3576586.
2012-11-08Rewrite of FbTk::TextureRenderMathias Gumz2-1130/+634
* much more readable and easier to read code * smaller code * reduced binary size due to removed big lookup-table for square root * simple 'optimizations (lookup tables, packing of data), nothing too fancy
2012-10-03Improved vertical alignment of text in FbTk::TextButtonMathias Gumz4-65/+109
The old formula for vertical align text inside FbTk::TextButton ('height/2 + font_ascent/2 - 1') produced not always good looking results, escpecially when different fonts are involved (eg, ClockTool and WorkspaceName have different fonts and font-sizes). '(height - font_ascent) / 2 - 1' produces better results. Additional changes: * added ASCII-Art to document the involved entities when calculating the baseline * rewritten tests/testFont.cc to accept multiples texts and multiple fonts * removed some internal parts of FbTk::Font from the public interface
2012-09-14removed duplicate function signature for FbTk::StringUtil::extractNumber()Mathias Gumz1-1/+1
2012-09-14minor cosmeticMathias Gumz1-4/+2
2012-09-14Fix regression: switch back to microseconds for DelayCmdMathias Gumz2-8/+12
2012-09-14Fix bug: (re)setting timeouts on a running FbTk::Timer might lead to broken ↵Mathias Gumz1-0/+9
timer list Setting a new timeout on a running FbTk::Timer must remove it from the timerlist, otherwise the list is not ordered correctly anymore. So, we stop the running FbTk::Timer, set the new timeout and restart it.
2012-08-28changed timing functions to use a monotonic increasing clockMathias Gumz7-191/+264
gettimeofday() is subject to be changed on daylight-saving or to ntp-related (think leap-seconds). even worse, it is subject to be changed BACK in time. this is hard to fix correctly (see commit 45726d3016e and bug #3560509). it is irrelevant for timers to know the nano-seconds since the epoch anyways.
2012-08-03Add menu.hilite.font and menu.hilite.justify style resourcesVladimir A. Pavlov3-20/+37
2012-08-03FbTk/ThemeItems.cc: move loading additional font resources to load()Vladimir A. Pavlov1-24/+20
The same logic had been already implemented for texture resources.
2012-08-03FbTk/ThemeItems.cc: don't use style resources in ↵Vladimir A. Pavlov1-16/+2
ThemeItem<Font>::setDefaultValue()
2012-04-10removed 'always-true' expressionPaul Tagliamonte1-1/+1
2012-04-10use the 'z' modifier for printing 'size_t' like variablesPaul Tagliamonte1-2/+2
2012-04-10Bugfix: Don't draw the interlace lines 1px too farMathias Gumz1-1/+1
2012-04-06Allow percentage values for some Window commandsLajos Koszti4-0/+89
2012-01-04FbTk/XrmDatabaseHelper.hh: operator== can be const.Ryan Pavlik1-1/+1
Found with cppcheck.
2012-01-04Check .empty() instead of .size() == 0Ryan Pavlik1-2/+2
Found with cppcheck.
2012-01-04Pre-increment non-primitive types.Ryan Pavlik6-9/+9
Found with cppcheck: "Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code."
2012-01-04No need to check if a pointer is null before de-allocating it.Paul Tagliamonte1-2/+1
5.3.5/2 of the C++ standard: "In either alternative, if the value of the operand of delete is the null pointer the operation has no effect."
2011-10-31src/Makefile.am,FbTk/StringUtil.cc: Search relative to the executable.Ryan Pavlik1-0/+65
On Windows, prepend /DUMMYPREFIX to default paths, and replace it at runtime with the prefix relative to the exe directory.
2011-10-31FbTk/StringUtil.cc: Don't return mid-routine.Ryan Pavlik1-2/+3
Prep for Windows dummy prefix code.
2011-10-31main.cc,FbTk/StringUtil.cc: On windows, use USERPROFILE instead of HOMERyan Pavlik1-0/+4
2011-10-31FbTk/FbString.cc,Font.cc: Windows doesn't have nl_langinfoRyan Pavlik2-4/+4
2011-10-31FbTk/Timer.cc: Check HAVE_SYS_SELECT_H, add alternate for windowsRyan Pavlik1-0/+2
2011-10-31Merge branches 'fix-out-of-range-memory', 'obey-configure' and ↵Ryan Pavlik5-11/+29
'other-improvements' into windows-mingw
2011-10-31FbTk/App.cc: make startup failure easier to diagnoseRyan Pavlik1-2/+7
2011-10-31FbTk/FileUtil.cc: Use only file masks defined.Ryan Pavlik1-3/+8
Needed for mingw-cross-env
2011-10-31FbTk/SignalHandler.cc: Use HAVE_SIGACTION, with signal() fallbackRyan Pavlik1-1/+7
This fixes platforms without sigaction, like Windows.
2011-10-31FbTk/Timer.cc: Check HAVE_SYS_SELECT_HRyan Pavlik1-1/+3
2011-10-31FbTk/StringUtil.cc: Fix out-of-range memory access.Ryan Pavlik1-1/+1
if pos is not npos, it will always be less than filename.size(). However, the access later is only safe if there is a character after pos, which would require pos + 1 to be less than filename.size.
2011-10-31FbTk/I18n.cc: Constructor should also check defined(NLS)Ryan Pavlik1-4/+4
2011-10-23bugfix: use the imlib cache for every imlib context usedMathias Gumz1-5/+5
calling imlib_set_cache_size() before a context is created by fluxbox creates an 'unknown' context. that one is never freed at shutdown.