aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
AgeCommit message (Collapse)AuthorFilesLines
2022-04-18Initial implementation of shortcut to windowsRichard Tamin1-1/+2
[PURPOSE] In editors such as vi and emacs, a user can mark a line in a file with a shortcut key and afterwards jump back to that line using the shortcut. The idea is extended to opened windows. A user can assign a keyboard shortcut to an opened window. Afterwards, the shortcut can be used to switch focus back to the marked window. Such shortcuts save the user from pressing "alt+tab" multiple times to cycle through windows until the desired one is found. [EXAMPLE USAGE] The following binding is added to file "~/.fluxbox/keys": Mod1 m ARG :MarkWindow Mod1 g ARG :GotoMarkedWindow User enters "alt+m x" to mark the currently focused window with shortcut key 'x' User enters "alt+g x" to switch focus to the marked window [IMPLEMENTATION SUMMARY] - Two new commands were added :MarkWindow and :GotoMarkedWindow - Keys.cc was modified: - addBinding() method supports parsing an argument placeholder where the user can pass in a shortcut key - doAction() method forwards the shortcut key to the command to execute - Class Keys::t_key was modified to recognize a placeholder key - New class ShortcutManager was added to maintain mapping of shortcut keys to marked windows
2022-04-18fix: Warn & attempt fallback for unsupported locale in text property conversionGlen Whitney1-2/+2
2016-07-30reposition visible submenus when changing styleThomas Lübking1-1/+4
a fixed position of the style menu won't help (the menu geometry changes *because* the item geometries do) - warping the pointer would likely be possible, but warping the pointer is cc. "evil" BUG: 715
2016-07-30reconfigTheme's on loading a new styleThomas Lübking1-0/+30
Also reconfigure menus (recursively) on style load The most critical call is the shape update - the menus often become cut-off, preventing mouse interaction with lower items, but also colors are not applied correctly to menus w/o updating them. BUG 1022 is most likely this and only a misinterpretation (for the mentioned items are those with lacking color updates on style updates) BUG: 1146 BUG: 1017 CCBUG: 1022
2016-07-01avoid calling into XLibThomas Lübking1-4/+12
Testing one bug, the function seems usually be called with the root window as parameter, so we can save a pointless lookup for the root of the root by testing against window before testing against window_root. Elegantly, this will "fix" the bug where XGetGeometry of the second heads root will either report the first heads root or some junk (xephyr case?) BUG: 1128
2015-02-05Feature: different MenuSearch modesMathias Gumz1-3/+4
Fluxbox now supports three MenuSearch modes: * NoWhere - essentially "disabling" the menu search. * Somewhere - the search string matches somewhere. * ItemStart - the search string matches at the start of a menu item. The default value is "ItemStart", just in the good old times. As long as this feature is not configurable via the menu it would irritate users with distinct muscle memory who type without thinking OR checking the visual feedback: they would trigger items they did not intent to trigger after years of the old behavior. Once this feature get's an entry in the config menu the default value might change.
2015-01-30Fix sometimes missing windowmenuMathias Gumz1-0/+1
When the windowmenu file is empty in ~/.fluxbox/init the code falls back to the default. In ab2eef4 I forgot to set the rc_path which caused this bug to happen.
2015-01-23CosmeticMathias Gumz1-1/+1
2015-01-22Add -no-slit and -no-toolbar flagsMathias Gumz1-102/+92
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-22Fix broken _NET_REQUEST_FRAME_EXTENTS supportMathias Gumz1-1/+6
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-22CosmeticMathias Gumz1-17/+5
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-04-11merge Sami Kerola's new build-systemMathias Gumz1-9/+0
2014-04-09use function fluxbox::findScreen()Mathias Gumz1-9/+1
2014-04-09fix excessive loading of keys file caused by xmodmapMathias Gumz1-11/+42
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-18Fix race condition on shutdownMathias Gumz1-73/+24
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-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-05-26build-sys: use AC_USE_SYSTEM_EXTENSIONSSami Kerola1-5/+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 Kerola1-4/+0
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.
2012-12-12Minor cleaning of 'class Fluxbox'Mathias Gumz1-2/+3
2012-12-12Fix build regression: enable XRANDR support by defaultMathias Gumz1-16/+33
The changes made in b178bed60b5bd8b2c9ed0cbc67fd729ff3820589 used the wrong variable to set the default state of '--enable-randr' in configure.in, that is fixed now. I also removed '--enable-randr12': If support for the Xrandr-extension is available at compile time we set HAVE_RANDR; if there is also support for Xrandr-1.2 (or higher), we also set HAVE_RANDR1_2 automatically. Other changes: * cleaned out public interface of 'class Fluxbox' * added 'RANDR' to output of 'fluxbox -info'
2012-12-05Simplified 'configure' / build systemMathias Gumz1-5/+5
* reduced duplicated auto-code * renamed '--enable-newwmspec' to '--enable-ewmh' * don't compile 'Slit'-code when '--disable-slit' * use AS_IF() in configure.in * use AS_HELP_STRING() instead of obsolete AC_HELP_STRING in configure.in * removed redundant calls to 'imlib2-config' to fill in $IMLIB2_CFLAGS and $IMLIB2_LIBS, AC_PATH_GENERIC() does that out of the box already
2012-08-28changed timing functions to use a monotonic increasing clockMathias Gumz1-3/+8
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-01-04Pre-increment non-primitive types.Ryan Pavlik1-6/+6
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."
2011-10-31fluxbox.cc: ifdef the signals windows doesn't have.Ryan Pavlik1-1/+8
2011-10-31fluxbox.cc: check HAVE_SYS_WAIT_HRyan Pavlik1-0/+2
2011-10-17removed obsolete handler for the gnome-window manager hintsMathias Gumz1-6/+0
nowadays every app should use the extended window manager hints exclusively.
2011-09-14Fix compilation with intel's compilerPavel Labath1-4/+0
the deleted function was never used, otherwise it would generate an error with other compilers as well. icc noticed that it was nonsensical even when it wasn't used and complained.
2011-05-10Convert FluxboxWindow::layerSig to FbTk::SignalPavel Labath1-20/+6
2011-05-10Convert FluxboxWindow::stateSig to FbTk::SignalPavel Labath1-25/+24
2011-05-10Convert FluxboxWindow::workspaceSig to FbTk::SignalPavel Labath1-4/+6
2011-05-10Convert Focusable::dieSig to FbTk::SignalPavel Labath1-32/+37
2011-03-23compile fix: sunCC 5.11 (sunstudio 12) compiles and links againMathias Gumz1-1/+1
biggest change: renaming of 'class Layer' to 'class ResourceLayer' in Layer.hh to handle complaints about 'ambiguous Layer: Layer or FbTk::Layer'. 'ResourceLayer' sounds crappy, but that was the best I could come up with right now.
2011-02-23renamed FbTk::XLayer to FbTk::Layer and FbTk::XLayerItem to FbTk::LayerItemMathias Gumz1-1/+1
2010-09-19pushed to early ...Mathias Gumz1-16/+64
2010-09-18changed the way we create the '~/.fluxbox' directory to avoid race conditionsMathias Gumz1-87/+16
before bringing up the first instance of Fluxbox we prepare the directory and the files it needs. if the config version of exiting files is lower than what we expect, we upgrade the config files. after that we bring up Fluxbox. the old way was problematic because setupConfigFiles() calls 'fluxbox-update_configs' which does its job in the background while fluxbox continues to boot. 'fluxbox-update_configs' sends a USR2 signal to the booting fluxbox (it might even be finished, no one knows) which triggers 'load_rc()' which triggered 'setupConfigFiles()' again which might trigger 'fluxbox-update_configs' again (on my machine 'fluxbox-update_configs' was called 3 times and left a pretty crippled 'keys' file when it was done). bootstrapping before bringing up fluxbox resolves the issue. as a bonus: no need to send USR2 to fluxbox to reload the config file because fluxbox has not even tried to read it yet.
2010-09-18cosmeticMathias Gumz1-8/+14
2010-09-15code deduplication by using <algorithm> and FbTk/STLUtil.hhMathias Gumz1-98/+38
2010-09-14bugfix: small typo in last cleanup prevented loading workspace namesMathias Gumz1-1/+1
2010-09-13cosmetic code cleaningMathias Gumz1-37/+30
* use FbTk::StringUtil::number2String() to avoid 'sprintf' * use FbTk::Util::clamp() * use FbTk::STLUtil::destroyAndClear() * whitespaces
2010-09-13code simplificationMathias Gumz1-59/+42
we do not need a std::map just to store an attribute on an AtomHandler, it makes housekeeping just more annoying.
2010-09-13code simplificationMathias Gumz1-56/+28
2010-09-11updated config version to '13' and adjusted 'fluxbox-update_configs' accordinglyMathias Gumz1-1/+1
our users should migrate seamlessly to our new windows-cycling behaviour without losing their current way of doing things. so, 'fluxbox-update_configs' tries its best to add '(workspace=[current])' wherever it looks like a valid place for it. such changed lines are marked by '!! FBCV13' at the end and can be easily spotted in case the updater got it wrong. addtional changes: * added '-check' to 'fluxbox-update_configs' to check the version number in '~/.fluxbox/init' vs. the version number of 'fluxbox-update_configs' * moved the update-code for each version into its own function, easier housekeeping
2010-09-09simpler codeMathias Gumz1-4/+1
2010-09-09minor cleanupMathias Gumz1-1/+1
2010-09-08simpler way of expressing 'Singleton' for 'FbAtoms'Mathias Gumz1-1/+1
2010-08-20implemented 'ActivateTab' action to (re)allow activation of tabs via mouseMathias Gumz1-1/+1
2010-05-05upgrade CONFIG_VERSION to 11Mathias Gumz1-1/+1
2010-03-17Changed #ifdef DEBUG ... cerr << to using fbdbg.Henrik Kinnunen1-24/+14
This will reduce the number of #ifdef DEBUG for simple debug messages. include "Debug.hh" and use fbdbg instead of cerr for debug.
2009-10-03compile fixes for sun compiler 5.10: complains about 'not beeing able to ↵Mathias Gumz1-1/+1
initialize this from that'