Commit graph

5505 commits

Author SHA1 Message Date
Mathias Gumz
ac4e11fe09 updated ChangeLog 2010-09-19 10:53:15 +02:00
Mathias Gumz
375c93241d merged conflicts 2010-09-19 08:49:59 +02:00
Mathias Gumz
e0c440f599 pushed to early ... 2010-09-19 08:48:35 +02:00
Mathias Gumz
e3a2c56252 compile fix: use 'CallMemFunWithRefArg' instead of bind2nd(mem_fun(), *foo)
g++-4.1 does not like parts of 12e1ef7826,
calling std::bind2nd(std::mem_fun(func), ref_arg) lead to a bunch of

   error: forming reference to reference type 'XYZ'

in order to avoid switching either back to the old for-loops or boost::bind
or to enforce a newer compiler (eg, g++-4.4) to the users a new helper
functor was created: 'CallMemFunWithRefArg'

this commit also fixes a little copy and paste error introduced in
12e1ef782, 'AtomHandler::updateClientClose' was called instead of
'AtomHandler::updateWorkspace'.
2010-09-19 08:46:21 +02:00
Mathias Gumz
0ef76292c5 changed the way we create the '~/.fluxbox' directory to avoid race conditions
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-18 17:51:30 +02:00
Mathias Gumz
c9c741c88d cosmetic 2010-09-18 17:27:28 +02:00
Mathias Gumz
9cf312fc9d recovered lost change from 041d586972
got lost in d3eabeb805 somehow
2010-09-18 09:26:05 +02:00
Mathias Gumz
87b45bd0d1 bugfix: avoid naive use of 'putenv' by providing 'FbTk::App::setenv()'
to quote from 'man putenv':

   The string pointed to by string becomes part of the environment,
   so altering the string changes the environment.

so, using putenv like

   {
      std::string foo("FOO=bar");
      putenv(foo.c_str());
   }

is wrong and leads to a potentially corrupted environment. valgrind
complaint correctly.

FbTk::App seems to be the appropriate place to hold '::seten()'
because it alters the environment of the application.
2010-09-17 23:43:24 +02:00
Mathias Gumz
f3ad09c4ce missing initializations
'valgrind' reported a lot of code branches based upon uninitialized
variables. some are not identified yet.
2010-09-17 23:34:03 +02:00
Mathias Gumz
87cffef7f5 request explicitly as many elements for the gradient tables as we need
the next step is to not use 'unsigned int' and then only store 'chars'
in it, maybe even using RGBA data instead of separated arrays for
r, g and b.
2010-09-17 23:32:02 +02:00
Mathias Gumz
786eef6e39 bugfix: forgot to resize 'pixels' before putting values into it (facepalm) 2010-09-17 23:26:56 +02:00
John K Pate
f1f7bebf37 added 'ArrangeWindowsVertical' to actions 2010-09-17 16:22:33 +02:00
Mathias Gumz
d3eabeb805 moved commandline parsing to its own function 2010-09-17 15:51:16 +02:00
Mathias Gumz
e84c64f7be lots of code cleanup, reordering, trimming public API, bugfixes
## FbTk/ImageControl.hh:

* moved 'getSqrt()' over to TextureRender.cc because it is used only there
* removed unused members m_root_window
* use std::vector<> for colors and for the gradient buffers.

## FbTk/ImageControl.cc:

* fixed memory leak in '~ImageControl', 'pixels' where not deleted[]
  at all. switched to std::vector, non-issue anymore.
* moved identical code into functions 'allocateUnallocatedColors', 'initColortables'

## FbTk/TextureRenderer:

* removed 'from', 'to', 'interlaced' from class, only used in
  'renderGradient()' and are actually part of the given
  texture.
* removed 'xtable', 'ytable' from class, only used in
  'renderGradient()'
* removed 'colors' from the class, is part of 'control'
* moved render actions (invert, bevel1, bevel2, *gradient), they need more
  love but for now this is sufficient
2010-09-17 15:34:12 +02:00
Mathias Gumz
603b36a2cc use FbTk::API to reduce code duplication 2010-09-17 14:46:01 +02:00
Mathias Gumz
041d586972 code simplification by reducing if-else hell
a lot of the parsing-related and menu-building stuff is just plain
stupid boiler plate code. putting the data into a const array
separates the boiler plate data from the actual code.
2010-09-17 14:44:58 +02:00
Mathias Gumz
0b1f160830 use hardcoded array for hardcoded placement menu defaults 2010-09-15 13:01:46 +02:00
Mathias Gumz
61bf564718 removed useless code
'tools' is transformed to lower case some lines above,
'm_tools_ is a copy of the lower cased 'tools'.
2010-09-15 12:44:14 +02:00
Mathias Gumz
0beda162d4 code deduplication by using <algorithm> and FbTk/STLUtil.hh 2010-09-15 12:43:30 +02:00
Mathias Gumz
12e1ef7826 code deduplication by using <algorithm> and FbTk/STLUtil.hh 2010-09-15 02:07:09 +02:00
Mathias Gumz
ba316aa18a code cleanup, missing commit for 2b62cf9733 2010-09-15 01:27:27 +02:00
Mathias Gumz
52f614b598 bugfix: 'reset' nr_shapes to '0' after last instance of 'Shape' 2010-09-15 01:23:56 +02:00
Mathias Gumz
2b62cf9733 cleanup and code deduplication
* ClientPattern.cc: make compiler happy (complaints about XPROP not handled in switch)
* FbTk/FbPixmap.cc FbTk/StringUtil.cc: signed vs unsigned
* FbTk/FbString.cc: missing return
* WinClient.cc: create atoms only once; use helper function
* Window.cc: use a helper function
2010-09-15 01:22:01 +02:00
Mathias Gumz
c6047e9eba use one array instead of two to hold both 'names' and 'atoms' for the rootwindow 2010-09-14 16:59:05 +02:00
Mathias Gumz
f39bcbd93c bugfix: create the corner pixmaps only once per screen
for each window (windows, menue etc) the initCorners() function of
FbTk/Shape.cc was called (which is ok). On each call the corner pixmaps
(of the Screen the window belongs to) were created and destroyed the
formerly created pixmaps. this is not needed.
2010-09-14 16:58:08 +02:00
Mathias Gumz
75b9a4ed72 bugfix: free the shape-corners on the last used 'Shape'
the global 's_corners' vector was still used on an application shutdown
(including ctrl-c SIGINT). depending on when 's_corners' was created on
the stack this could lead to an exception ('pure virtual called') while
trying to free the 'FbPixmaps' without having a valid
'FbTk::Application::instance()' left.
2010-09-14 16:54:08 +02:00
Mathias Gumz
36893ac7f9 bugfix: small typo in last cleanup prevented loading workspace names 2010-09-14 12:24:20 +02:00
Mathias Gumz
b10d58588a cosmetic code cleaning
* use FbTk::StringUtil::number2String() to avoid 'sprintf'
* use FbTk::Util::clamp()
* use FbTk::STLUtil::destroyAndClear()
* whitespaces
2010-09-13 22:07:10 +02:00
Mathias Gumz
deb6a1ebf4 code simplification
we do not need a std::map just to store an attribute on an AtomHandler,
it makes housekeeping just more annoying.
2010-09-13 22:04:24 +02:00
Mathias Gumz
f6af17aa58 code simplification 2010-09-13 21:59:09 +02:00
Mathias Gumz
24e4e98dbe updated config version to '13' and adjusted 'fluxbox-update_configs' accordingly
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-11 22:04:15 +02:00
Mathias Gumz
51f054e777 added '(workspace=[current])' to our default keys
commit 882a50fe1d removed the hardcoded limit to
cycle to windows on other workspaces, though it was and IS a good default
behaviour. if users do not want this (they want to cycle to windows on other
workspaces), they should explicitly avoid '(workspace=[current])' in their
keysfile.
2010-09-11 21:53:55 +02:00
Mathias Gumz
faa4c97888 added 'SetXProp' action and (@PROP=foo) clientpattern
these two allow 'tagging' of arbitrary windows with 'tags' (or 'labels'). such 'tagged' windows can then be used in ':NextWindow (@PROP=foo)' commands to quickly cycle through a subset of available windows.
since the 'tags' are applied as real xproperties to a window they survive a restart of fluxbox or even another windowmanager. the user can also set the tags by using xprop(1).

the next step regarding the UI should be to visualize the tags of a window.
2010-09-11 17:09:07 +02:00
Mathias Gumz
4e2c7e2167 moved helper struct TextPropPtr into anonymous namespace 2010-09-10 16:36:17 +02:00
Mathias Gumz
a6ed9498cc code cleanup
* moved code from public API to internals
* avoid code duplication ( while(!m_terms.empty()) ...)
* cosmetic '(*it)->' vs 'term.'
2010-09-10 16:35:49 +02:00
Mathias Gumz
882a50fe1d removed hardcoded limitation to cycle/focus windows on all workspaces
reasons:

* fixes #1732115, allows to have chatwindows on another workspaces and reach them via :NextWindow (urgent=yes)
* old behavior can be achieve by using the (workspace=[current]) pattern
2010-09-10 13:32:47 +02:00
Mathias Gumz
8a7c117153 disabled potentially dead code 2010-09-09 23:24:47 +02:00
Mathias Gumz
ecdaba2874 simpler code 2010-09-09 23:24:27 +02:00
Mathias Gumz
ffd5f28072 removed dead code 2010-09-09 23:23:52 +02:00
Mathias Gumz
7fdb0676a7 bugfix: initialize the Shape of a menu AFTER we created the window for the menu
on startup a lot of 'Fluxbox: X Error: BadDrawable (invalid Pixmap ...)' occured.
this was caused by using an empty 'Window' to create the shape.
2010-09-09 23:23:33 +02:00
Mathias Gumz
2b9a38cba5 minor cleanup 2010-09-09 15:33:34 +02:00
Mathias Gumz
534db1d409 reduced 'switch/case' and 'else if' hell a little bit 2010-09-09 15:33:12 +02:00
Mathias Gumz
77f39235cf added FbTk::Util::clamp() and simplified related code 2010-09-09 15:31:54 +02:00
Mathias Gumz
1657374940 use FbTk apis instead of raw xlib calls 2010-09-09 12:48:19 +02:00
Mathias Gumz
e685117941 simpler to use FbTk/Timer api 2010-09-09 12:47:38 +02:00
Mathias Gumz
82d0de9ef4 cosmetic 2010-09-08 22:31:41 +02:00
Mathias Gumz
8a08110f19 simpler way of expressing 'Singleton' for 'FbAtoms' 2010-09-08 22:09:06 +02:00
Mathias Gumz
dc5a105c3e fixed code duplication 2010-09-08 21:52:13 +02:00
Mathias Gumz
7a149626e6 improved 'escapeRememberChars()' routine by traversing the string only once
removed obsolete 'getuint()' function
2010-09-08 21:45:33 +02:00
Mathias Gumz
48cc67965b avoid code duplication 2010-09-08 21:43:38 +02:00