Commit graph

4491 commits

Author SHA1 Message Date
Mario J. Rugiero
2238c004aa Reduce the scope of the variable err in stringTokensBetween. 2015-05-01 10:46:21 +02:00
Mario J. Rugiero
2275e1e6e4 doSubmenu function in menutest.cc avoids copying labelstr by using a const reference. 2015-05-01 10:46:21 +02:00
Mario J. Rugiero
bf607341da addMatching and insertFromParent functions from FocusableList now avoid copying m_parent->clientList() and use a const reference instead. 2015-05-01 10:46:21 +02:00
Mario J. Rugiero
63f89cb433 Pass pre_command to CommandDialog as const reference to avoid unnecessary copying. 2015-05-01 10:46:20 +02:00
Casey Dahlin
79a358346a Don't assume ICONV_NULL = 0
We define the value ICONV_NULL = -1, but when we attempt to set the
s_iconv_convs array to all NULL values, we zero the array instead of setting
its entries to -1.

This patch properly initializes and wipes s_iconv_convs.
2015-04-11 08:25:59 +02:00
Arkadiusz Bokowy
e3300411eb Fix: typo during refactoring
Commit 63d9d69 introduced a bug, which has manifested itself by setting
window transparent state to the fully opaque (255).
2015-02-08 11:14:48 +01:00
Mathias Gumz
9f824b89fd Move internal code to internal side of FbTk::Transparent 2015-02-08 11:06:58 +01:00
Mathias Gumz
f84671ef8e Minor 2015-02-07 18:05:41 +01:00
Mathias Gumz
bd983fab55 Create buttons for titlebar with proper sizes
Instead of creating the titlebar buttons with a size of 10x10 pixels
and rely on resizing later on we now pick the correct dimensions
right on.

This fixes also bug #1125 ("Detaching a window from a tab-group renders
app-icon to 1/2"); the problem also occurred on restart.

I took the chance to refactor a little bit.
2015-02-07 17:59:37 +01:00
Mathias Gumz
c30b75091a Fix glitch of TabOptions menu 2015-02-07 11:46:00 +01:00
Mathias Gumz
9814549fb3 Show toggleitems in menu 2015-02-07 10:13:43 +01:00
Mathias Gumz
17bd806337 Cosmetic 2015-02-07 10:09:24 +01:00
Mathias Gumz
1bacaa7ecb Boyscouting 2015-02-07 09:41:38 +01:00
Mathias Gumz
046092d166 Fix cleaning exposed menu items 2015-02-07 09:38:22 +01:00
Mathias Gumz
8834435bd0 Avoid signed/unsigned woes; minor cleanup 2015-02-07 09:30:28 +01:00
Mathias Gumz
a649a45ed8 Add uncommited #include "MenuSearch.hh"
Note to myself: less gitting at late hours.
2015-02-06 07:31:04 +01:00
Mathias Gumz
92940571f3 Cleanup; Remove unused function 2015-02-05 21:35:02 +01:00
Mathias Gumz
0da4be2a01 Feature: different MenuSearch modes
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-02-05 21:30:44 +01:00
Mathias Gumz
e79228cc08 Fix problem with too small WinButtons
Under some circumstances a WinButton might be tiny (1x1 pixel). Substracting
values > 1 yields either 0 or something reaaaaly big (UINT_MAX). This will
make fluxbox either crash or make it act weird. We don't want this.
2015-02-04 21:06:51 +01:00
Mathias Gumz
53b3120b32 Move nls globals into #ifdef NLS 2015-02-04 21:06:32 +01:00
Mathias Gumz
461d4b7dbd Fix crash: click the Remember-menu works again
This commit fixes a subtle regression introduced by myself in
f64727ca: WinClient wc = FbMenu::window()->winclient() creates a
copy and this copy gets cleaned up at the end of the scope. What
I really wanted was a reference.
2015-02-01 19:41:07 +01:00
Mathias Gumz
c207226a32 Fix regression: use proper texture for the grips 2015-02-01 09:40:49 +01:00
Mathias Gumz
e1359adfd0 Cosmetic 2015-02-01 08:07:26 +01:00
Mathias Gumz
fff0abad76 Improve I18n support
Among the first steps to produce better i18n support is to test the created
translations adhoc without running "make install". To achieve this, fluxbox
now honors several environment variables:

- NLSPATH: fluxbox won't create the absolute path to the catalog and thus
  catopen() is free to use NLSPATH as described in the manpage. Example
  given: "/tmp/%N" will pick "/tmp/fluxbox.cat". %N refers to FLUXBOX_CATFILE.

- FLUXBOX_CATFILE: By setting FLUXBOX_CATFILE the users can make fluxbox to
  use a different name for the catalog file.  Default: "fluxbox.cat"

- FLUXBOX_CATDIR: Per default fluxbox tries to find FLUXBOX_CATFILE at several
  places. Setting this environment variable allows to point fluxbox to a
  different search path for the catalog files.

Then, fluxbox tries catopen() first without changing the deduced catalog file
name. After that it applies some heuristics to get a good catalog file name.
2015-01-31 21:37:44 +01:00
Mathias Gumz
0a87632032 Clean up FbTk::I18n API
Move private stuff into FbTk/I18n.cc.
2015-01-31 12:04:30 +01:00
Mathias Gumz
f8b9c9a211 Fix sometimes missing windowmenu
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-30 22:09:27 +01:00
Mathias Gumz
bf43ba16c4 Use strncpy() instead of strcpy() 2015-01-29 11:52:00 +01:00
Mathias Gumz
37e8c1e93e Use strncpy() instead of strcpy() 2015-01-29 11:46:57 +01:00
Mathias Gumz
129d0ac31e Make fluxbox strcat() free
Again, gcc-4.2.1 of OpenBSD-5.6 pointed out the use of strcat(). I took the
chance to explain the reasons for the code a little bit.
2015-01-29 11:43:05 +01:00
Mathias Gumz
8b44c7a184 Simpler code to set _NET_DESKTOP_NAMES
gcc-4.2.1 on OpenBSD-5.6 hinted that strcpy() is not the safest function on
earth. While seeing the code I wondered why it we first create copies
of the names at all (let alone using memset() and then strcpy() after it).
2015-01-29 11:38:48 +01:00
Mathias Gumz
8e5a10ea6c Compiler boyscouting: init order 2015-01-28 21:44:20 +01:00
Mathias Gumz
876500a259 Fix correctness of string search
The lookup for the skip value needs to be based upon the lowercase version of
the current byte.
2015-01-28 21:42:05 +01:00
Mathias Gumz
aa39a1a666 Fix mishandled [maxmized] statement in apps file
In f64727ca I removed one 'else' too much. As a result all [maximized] lines
were mapped to MAX_NONE. Fixed.

The rest of the commit is just some cosmetic to reduce indentation and shorten
function names, easier to read.
2015-01-28 20:28:58 +01:00
Mathias Gumz
03ce82a473 Feature: typeahead in menu matches text anywhere
This commit implements a tweak to the typeahead feature already existent in
fluxbox: If the user opens up a menu and starts typing, fluxbox tries to
detect matching menu items and makes them available for quick selection.
The typed pattern is now search also in the middle of the text.

I opted to strip down the code quite a bit and remove complexity by throwing
out FbTk::TypeAhead and FbTk::SearchResult because I do not see the need for a
general solution when the only use case for such a feature is in fluxbox'
menus. FbTk::ITypeAheadable shrunk down to 2 functions; the whole file might
be combined with the code that implements FbTk::Menu::TypeSearch.
FbTk::Menu::setIndex() and related code is also gone: the position of each
menu item is defined by it's position in the items container. This reduces the
mount of book keeping fluxbox has to do. Fewer moving parts is a good thing.

It's possible that users start to complaint because they expect their
typed pattern to match only at the beginning of the text OR that some
demand other tweaks. We will see.

This commit also fixes a regression introduced by 8387742c. The bug made
the menu vanish.
2015-01-28 16:02:59 +01:00
Mathias Gumz
75cf246de5 Cleanup 2015-01-24 10:36:00 +01:00
Mathias Gumz
e0c5436f44 Improve code documentation
'width' might imply something 'aligned horizontally'. The first parameter
of maxTextLength() is given in pixels. To avoid confusion, the name of
the parameter is changed.

The comment before the binary search reflects better why and what we
need to do.
2015-01-24 10:35:21 +01:00
Mathias Gumz
00cca1284f Fix text rendering in rotated TextButtons
A vertically rotated text should be checked against the height of the
button, not the width of it.

Fixes #1119 ("Toolbar cannot display full text of workspace/​clock/​window
title.")
2015-01-24 10:31:38 +01:00
Mathias Gumz
67c31b49bd Refactor Toolbar.cc, less noise 2015-01-23 23:38:34 +01:00
Mathias Gumz
63d9d695be Refactor FbWinFrame
FbWinFrame is now simpler to read due to less overall noise.
2015-01-23 15:23:02 +01:00
Mathias Gumz
0d8a3dfb6b Cosmetic 2015-01-23 15:17:02 +01:00
Mathias Gumz
ab2eef4937 Add -no-slit and -no-toolbar flags
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-22 16:28:53 +01:00
Mathias Gumz
6fc392fb64 Remove 'always true' condition 2015-01-22 10:14:59 +01:00
Mathias Gumz
c0e5d1c7a3 Fix broken _NET_REQUEST_FRAME_EXTENTS support
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-22 10:14:12 +01:00
Mathias Gumz
5428edf3da Fix removing windows from icon list
std::remove_if() removes an item from a container and returns a
past-the-end iterator ... which equals m_icon_list.end(). As a result
the check

    if (erase_it != m_icon_list.end()) {
        iconList().erase(erase_it);
        iconListSig().emit(*this);
    }

will never succeed and thus the iconListSig() will never be emitted.
2015-01-22 10:09:08 +01:00
Mathias Gumz
1ec4fb6b6c Cosmetic 2015-01-22 09:45:35 +01:00
Mathias Gumz
6d749d6f1a Cosmetic 2015-01-21 22:16:38 +01:00
Mathias Gumz
e2dbdeeb2e Fix segfault on shutdown
There was a problem deep within how the menus were connected and when and
what gets deleted. It was clearly related to a menu which was kind of
global. In order to better understand the code flow I eliminated the
ExtraMenu code: it was used only to get the Remember-Menu into the
Window-Menu. Instead of having a singleton of the Remember-Menu and fight
against the shaky interconnections we just create a new one on demand
and delete when the menu gets deleted. Looks like this fixes the problem.

The menu code needs more love anyway.

Closes #1118
2015-01-21 22:16:19 +01:00
Mathias Gumz
145cf94ea6 Refactor: bundle related members together
Also: try to avoid unsigned/signed problems in drawing code.
2015-01-21 21:59:42 +01:00
Mathias Gumz
f64727caff Cosmetic: less code bloat 2015-01-21 21:54:30 +01:00
Mathias Gumz
dae7fca7cb Fix potential memory leak
If allocation of I2 does not succeed, we need to free I1.

Closes #1120
2015-01-21 21:53:00 +01:00
Mathias Gumz
980ab5e3f5 Fix behavior for autorepeat keys
This reverts 58e09b7190 after having regressions
and bug reports in regards to autorepeated key events are not working anymore.

So, the problem with the lost keypress after the workspace change is still
open but at least the behavior for other folks is as it was. Since 58e09b7190
seems to be corelated to "auto repeat" keys it might indicate the problem
which 58e09b7190 "fixed". We will see.

Fixes #1115.
2015-01-21 10:06:01 +01:00
Mathias Gumz
8e92ad53e0 Minor cosmetics 2015-01-21 10:02:38 +01:00
Mathias Gumz
2b70480b97 Fix compile errors with clang 2015-01-21 09:53:54 +01:00
Mathias Gumz
d3c960da99 Remove unused variable 2015-01-21 09:53:16 +01:00
Mathias Gumz
382d7be6f6 Fix compile error: old g++ does not like c-like struct initialization 2015-01-19 08:29:48 +01:00
Mathias Gumz
11566bbb83 Fix uncommited change (see 8387742c8...) 2015-01-16 13:08:53 +01:00
Mathias Gumz
5ede399d4d Fix casting issues 2015-01-16 10:52:38 +01:00
Mathias Gumz
772ec14595 Fix uninitialized variables; cosmetics
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-16 10:52:00 +01:00
Mathias Gumz
e37cad714c Avoid modulo 0
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-16 10:47:01 +01:00
Mathias Gumz
a65e9c686e Fix semantic errors (wrong variable names etc)
Uncovered by coverity-scan.
2015-01-16 10:38:32 +01:00
Mathias Gumz
df996370d0 Fix leak in ClientPatternTestCmd
Coverity-scan points to the leaking ClientPattern. The rest is just
cosmetics.
2015-01-16 10:36:14 +01:00
Mathias Gumz
b30438c311 Refactor: bundle xinerama-info together, simpler code
Part of this massive looking but simple rather simple change is a the way we
check for active Xinerama: XineramaIsActive() was used before. The docs for
XineramaQueryScreens() state that

    XineramaQueryScreens() returns NULL and sets number to
    0 if Xinerama is not active.

Sold.
2015-01-16 08:45:11 +01:00
Mathias Gumz
6d5781ce71 Refactor: move some menu-creation functions to MenuCreator
Another patch to trim down the code that needs to be part of BScreen
2015-01-16 08:39:05 +01:00
Mathias Gumz
b495878065 Reduce number of allocations for menu creation
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-16 08:36:49 +01:00
Mathias Gumz
bd9afcafb9 Refactor: split out menu generation from BScreen
Again, it's easier to read the code when the whole menu-generation is out of
the way.
2015-01-15 18:49:45 +01:00
Mathias Gumz
8387742c88 Refactor menu code: be more explicit and compact
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-15 14:25:05 +01:00
Mathias Gumz
dc9793c90a Code cleanup
Reorder some includes; remove unused includes
2015-01-10 22:57:00 +01:00
Mathias Gumz
b16528de87 Make use of API instead of hardcoded default font 2015-01-10 22:56:28 +01:00
Mathias Gumz
c47280236f Fix order of reconfigure the theme of an IconButton
The font might have an impact to the result of width() and height(). In order
to render the new pixmap correctly fluxbox now first sets the font and the
width of the border and after that it recreates the pixmap.
2015-01-10 22:53:37 +01:00
Mathias Gumz
09da97e6f3 Remove dead code 2015-01-10 22:51:57 +01:00
Mathias Gumz
7b8fd2d81a Fix bug: integer underflow in startup phase
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-10 22:51:04 +01:00
Mathias Gumz
d8c11d0852 Fix 'make check' 2015-01-05 21:38:14 +01:00
Mathias Gumz
f8d0bd4cb3 Fix build-system: install data files (keys, apps, menu ...)
* 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-05 15:08:32 +01:00
Mathias Gumz
0820bcb640 Fix build-system: use xxx_LDADD instead of xxx_LDFLAGS
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-04 16:21:02 +01:00
Nable 80
ad968e32b3 Fix to make clang happy
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-03 21:47:51 +01:00
Mathias Gumz
90f2fcf031 Minor API change for OSDWindow
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-03 21:45:14 +01:00
Mathias Gumz
3c85ace912 Fix signature ITypeAheadable::isEnabled() 2015-01-03 21:44:31 +01:00
Mathias Gumz
ccd86cfe9c Fix signature FbTk::FontImp::rotate() 2015-01-03 21:43:51 +01:00
Mathias Gumz
63f9a1637f Clean unused variables 2015-01-03 21:42:24 +01:00
Mathias Gumz
60e97b968b Fix clang warning 'expression with side effects' 2015-01-03 21:36:35 +01:00
Mathias Gumz
fb7bc7380d Fix number2*() functions
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-03 21:33:20 +01:00
Mathias Gumz
6fe7fbdc6b Remove dead / unused code
Again: Compiler happy, we are happy.
2015-01-03 18:50:20 +01:00
Mathias Gumz
65e0654249 Fix typo / editor bug or something like that.
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-03 18:45:28 +01:00
Mathias Gumz
bd519dd952 Remove various unused variables
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-03 18:43:44 +01:00
Mathias Gumz
11974fa40a Update copyright info 2015-01-03 18:40:55 +01:00
Mathias Gumz
3e76d43987 Use correct buffer size for number2*() 2015-01-03 18:39:09 +01:00
Mathias Gumz
4952718536 Fix build issue 2015-01-03 14:40:56 +01:00
Mathias Gumz
a8dfb56739 Remove reference to src/tests/testSignal 2015-01-03 14:39:59 +01:00
Mathias Gumz
376ed523cb Update release version 2015-01-03 14:07:34 +01:00
Mathias Gumz
2309751143 make use of FbTk-api 2014-10-27 13:46:32 +01:00
Mathias Gumz
c5fd69cc9d treat windows having WM_CLASS == "DockApp" like DockApps
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-29 09:26:52 +02:00
Arkadiusz Bokowy
ed7bcc5dbc Corrections for border width for relative resize 2014-09-29 09:06:03 +02:00
Arkadiusz Bokowy
786d8bacc0 Code cleanup
File name expansion is done internally by the Slit::loadClientList, so there
is no need to duplicate the code.
2014-09-14 19:09:11 +02:00
Mathias Gumz
f0a178f515 fix: check the correct XClassHint property
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-09-14 17:52:29 +02:00
Mathias Gumz
026343b6b1 fix uninitialized variables 2014-07-22 22:25:47 +02:00
Mathias Gumz
5f45524211 fix _NET_MOVERESIZE_WINDOW resize issue (#1108)
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-07-22 22:03:33 +02:00
Mathias Gumz
f3e82cae83 allow a timeout of a full 'unit'
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-12 12:28:31 +02:00
Mathias Gumz
6700eb354f cosmetic, less code 2014-05-12 12:27:46 +02:00
Mathias Gumz
948e63eb60 detect minute-based strftime-formats (again)
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-12 12:17:00 +02:00
Mathias Gumz
913244789f fix clocktool lagging behind and skipping seconds
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-05-12 10:22:49 +02:00
Mathias Gumz
9b40943dea removed reference to 'defaults.hh' 2014-04-11 17:58:28 +02:00
Mathias Gumz
e105de7d46 merge Sami Kerola's new build-system 2014-04-11 17:42:40 +02:00
Mathias Gumz
bc272ba4ae use function fluxbox::findScreen() 2014-04-09 22:44:05 +02:00
Mathias Gumz
617635f8eb fix excessive loading of keys file caused by xmodmap
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-04-09 22:40:13 +02:00
Amadeusz Sławiński
559947186e make sure that result of division is signed int
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-19 17:41:15 +01:00
Mathias Gumz
43bdf499d5 Fix race condition on shutdown
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-18 19:34:35 +01:00
Mathias Gumz
3696562aa8 update of copyright info 2014-02-17 20:14:49 +01:00
Mathias Gumz
ff3635ad0a Fix ArrangeWindowsStack* for multi-head displays
* 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-02 11:19:26 +02:00
John Sennesael
57ec44e994 Add support for stacked tiling via ArrangeWindows* 2013-08-02 08:56:07 +02:00
Ed Martin
58e09b7190 Fix lost keypresses after workspace change (#1067)
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-08-02 08:46:45 +02:00
Raphael Kubo da Costa
0084149c3d Constify the type passed to std::equal_to.
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-07-03 14:29:39 +02:00
Mathias Gumz
f464f24eb3 fix detection of $HOME folder
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-29 08:39:02 +02:00
Mathias Gumz
2efd4b8230 cosmetics 2013-06-22 09:45:48 +02:00
Mathias Gumz
118ea25f9d Speedup overlong text detection
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-06-18 17:43:28 +02:00
Sami Kerola
7541054b29 build-sys: move to non-recursive build
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-26 10:38:11 +01:00
Sami Kerola
9e5eddfc3d build-sys: use pkg-config to locate dependencies
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-26 10:38:10 +01:00
Sami Kerola
47b9786533 build-sys: use AC_USE_SYSTEM_EXTENSIONS
The earlier _GNU_SOURCE definitions possibly did not take effect
everywhere where it was intended.
2013-05-26 10:38:10 +01:00
Sami Kerola
73b7958770 build-sys: include config.h to all files using automake
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-26 10:38:10 +01:00
Mathias Gumz
c6489ab1b1 more compact code 2013-05-23 09:19:34 +02:00
Mathias Gumz
2da8086673 Use shared code, minor code simplification 2013-05-23 09:18:37 +02:00
Mathias Gumz
9b0cedf961 minor 2013-05-23 09:16:19 +02:00
Peter Hercek
e00c2b784a fix initial window placement to allow proper head detection and window placement based on apps file
* a reasonable initial placement is important for later movements to
  different heads and correct head detection (required by apps file)
* it did not work well in case when (0,0) was not near any head
2013-05-23 08:27:18 +02:00
Peter Hercek
5e3217441a fix head detection for adjacent heads of too different sizes and window placement based on apps file
* if you have e.g a 1920x1200 monitor and a small 800x600 monitor to the
  right of the bigger one and a small window at the right side of the
  big monitor (but still the whole window area at the big monitor) then
  the original head detection would claim the window is on the small
  monitor because (800/2+windowWidth/2 < 1920/2+windowWidth/2) is true
  for small windows; but that is obviously wrong, the window is entirely
  on the big monitor
* these incorrect head detections did lead to incorrect window
  placements as they were required in the apps file
2013-05-23 08:27:15 +02:00
Mathias Gumz
6dca40aae6 Fix regression in rendering the Window-Motion-Outline
Commit 79fe2fca1d checks for pending
motion events and drops out of the FluxboxWindow::motionNotifyEvent() function
early if so. When the user does not use the opaque window movement method an
outline will be drawn to the screen. That outline was not cleaned correctly
with commit 79..
2013-05-16 07:39:54 +02:00
Mathias Gumz
52c374570e minor code simplifications 2013-02-27 09:50:29 +01:00
Soeren Beye
0810d7db5e Workspace switching on the toolbar via the mouse buttons 2013-02-27 09:46:47 +01:00
Mathias Gumz
ec7fe513c8 Trigger ClockTool every second, independent of the format string
It's hard to hit right moment to update the clock correctly: Either we are a
bit too early and the 'old time' is the same as the 'new time' and the clock
looks 'a bit off' or we are too late and the clock is 'a bit off'. This is
especially the case for format strings which do not show the second and thus
are updated only at the full minute (see bug #1082): if fluxbox does not
update the clock 'now' it would do it one minute later and thus the clock
might show the wrong time for roughly 1 minute.

Instead of coming up with something immensely clever we just trigger the
ClockTool every second. If no update of the shown time is needed fluxbox won't
do anything.

Some minor code reordering as byproduct.
2013-02-14 19:58:28 +01:00
Mathias Gumz
ac27c8cb42 Updates copyright date information in some binaries 2013-02-14 19:45:17 +01:00
Mathias Gumz
59f59801fc Fix missing LogicCommands
By removing FbTk/LogicCommands.o from LDADD in src/Makefile.am (commit
06655f6) I prevented the linker to pick up FbTk/LogicCommands.o and thus
rendered all logic-commands useless.

Using a small helper object to pull in the dependency fixes this problem
without relying on manually tweaking the build system.
2013-02-13 10:50:25 +01:00
Mathias Gumz
7c26156842 Initialize FbTk::Timer.m_timeout correctly 2013-02-13 10:30:55 +01:00
Mathias Gumz
cf56f32b29 Remove unused variables, cosmetics 2013-02-10 12:21:29 +01:00
Mathias Gumz
b039122182 FbTk::FbTime::mono() yields microseconds since fluxbox started 2013-02-10 11:10:36 +01:00
Mathias Gumz
34744f504e Cleanup 2013-02-10 11:08:05 +01:00
Mathias Gumz
2e98d9ed0d More subtle brightening of textures 2013-02-10 10:24:55 +01:00
Mathias Gumz
34343bb20b Feature #3602124: 'LHalf' and 'RHalf' buttons to the titlebar
First draft of feature request of #3602124: Having 2 buttons in the titlebar
which allow quick positioning of a Window into the left or right half of the
current monitor.
2013-02-06 13:47:17 +01:00
Mathias Gumz
94fddc09c0 Fix bug in renderEllipticGradient()
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-06 08:54:09 +01:00
Mathias Gumz
0b41d0b908 Minor cosmetics 2013-02-06 08:09:08 +01:00
Mathias Gumz
41a2060720 Fix integer overflow
I forgot this piece in 779618e45d.
2013-02-06 08:07:30 +01:00
Mathias Gumz
a4a4bca745 Reduces memory footprint
The buffer for some gradients does not have to be width * height big when two
lines are sufficient.
2013-02-06 08:04:47 +01:00
Mathias Gumz
6514398bea Branchless code for interlacing a texture 2013-02-06 07:49:54 +01:00
Mathias Gumz
779618e45d Fix integer overflow for bigger textures 2013-02-06 01:45:38 +01:00
Mathias Gumz
3e4ee48bf1 Fix regression regarding timers with equal end-time
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-02-01 20:36:30 +01:00
Mathias Gumz
dc47491533 Adds 'ClientPatternTest' command
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-31 09:14:06 +01:00
Mathias Gumz
716532dd47 Calculates timeouts of ClockTool based upon System Clock
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-26 09:21:47 +01:00
Mathias Gumz
e7bfc63932 Improve calculation of brighter colors
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-23 09:46:08 +01:00
Mathias Gumz
bf5da7f1b6 Fix bug: actually invert a given Texture
Stupid typo.
2013-01-17 10:58:53 +01:00
Mathias Gumz
33161595f4 Simplifies and fix bugs in FbTk::Timer
* Calling Timer::setTimeout() from within Timer::start() might lead to ugly
  behavior (as experienced in bugs #3590078, #3600143, etc; see commit
  4d307dcd10, 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-15 21:40:33 +01:00
Mathias Gumz
239e895826 Ensure textures have the correct size bevor applying 'bevel' 2013-01-13 12:44:19 +01:00
Mathias Gumz
5f7acf3fb6 Optimize inner loop of pixel transfer in TrueColor
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-13 12:37:26 +01:00
Mathias Gumz
eb725c5c2d Use the same lookup-tables for solid and gradient textures 2013-01-13 12:34:30 +01:00
Mathias Gumz
8143b86fec improved code documentation 2013-01-13 12:25:00 +01:00
Mathias Gumz
13b9ee09ee Minor optimization of handling the timers 2013-01-13 12:23:06 +01:00
Mathias Gumz
4d307dcd10 Fix bug: handle the list of Timers not in-place
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-12 09:24:11 +01:00
Mathias Gumz
06655f6d7f Optional removal of SystemTray tool
Added the option to remove the SystemTray tool completely from
fluxbox.
2013-01-10 12:11:24 +01:00
Aymeric Vincent
79fe2fca1d Reduced lagging begind of windows on slower displays
In certain situations a speedy mouse might generate more move-events
than fluxbox can handle: The event queue will fill up faster than the
repositioning of the window is finished. The user will experience a
window which lags behind the mouse cursor, aka the window-dance.

We now check the next event in the queue and postpone the move a little
bit so the queue does not fill up that fast.
2013-01-10 08:16:01 +01:00
Sami Kerola
f12e149baf automake: use AM_CPPFLAGS rather than INCLUDES
The INCLUDES macro deprecated in favour of AM_CPPFLAGS.

References: http://www.gnu.org/software/automake/manual/html_node/Program-Variables.html
2013-01-03 08:17:27 +01:00
Sami Kerola
b825874d2e do not try to reach $(top_srcdir)/.git directory contents when building a release tar ball 2013-01-02 10:08:11 +01:00
Mathias Gumz
f587cc9e7e Compile fix: forgotten parentheses around value 2013-01-02 09:57:32 +01:00
Sami Kerola
1f89a19cfc replace XKeycodeToKeysym() with XkbKeycodeToKeysym()
The XKeycodeToKeysym() is deprecated.

References: http://comments.gmane.org/gmane.comp.misc.suckless/9403
2012-12-30 20:31:25 +01:00
Vladimir A. Pavlov
5efef22cba Fix double text rendering if using parentRelative 2012-12-30 12:27:55 +01:00
Vladimir A. Pavlov
edcb6d57ce src/WinButton.{cc,hh}: cosmetic 2012-12-30 12:27:52 +01:00
Vladimir A. Pavlov
c8d0945a8f Make use of window.stuck.pressed.pixmap 2012-12-30 12:27:47 +01:00
Vladimir A. Pavlov
36489e4a17 Set WM_WINDOW_ROLE for fluxbox windows 2012-12-30 12:27:43 +01:00
Mathias Gumz
95f8f33c90 Minor cleaning of 'class Fluxbox' 2012-12-12 10:19:09 +01:00
Mathias Gumz
4191cbf2d2 Fix build regression: enable XRANDR support by default
The changes made in b178bed60b 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-12 10:18:20 +01:00
Mathias Gumz
d8cd6a928b Fixed bug: use expanded style/theme filename
'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-12-11 19:37:59 +01:00
Mathias Gumz
b178bed60b Simplified 'configure' / build system
* 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-12-05 16:00:55 +01:00
Hendrik Iben
24541caf69 Fixed lost focus glitch on multihead-ws-warping 2012-11-25 08:29:41 +01:00
Hendrik Iben
e65a966d80 Added option for focus revert to stay on current head 2012-11-20 08:04:50 +01:00
Mathias Gumz
b4534e0f28 Rewrite of FbTk::TextureRender
* 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-11-08 11:02:28 +01:00
Julien Viard de Galbert
5c5ad62846 Adds the OnTab keyword for the keys file
Adding the following lines to the keys file restore the old behaviour to
use Mouse2 on tabs to start tabbing, and keep OnTitlebar Mouse2 to lower
the window.

OnTab Mouse2 :StartTabbing
OnTab Move1 :StartMoving

Note: Internal tabs are triggering both OnTab and OnTitlebar events.
2012-11-07 09:41:49 +01:00
Mathias Gumz
e8f2e964c6 minor cosmetic 2012-10-04 09:56:15 +02:00
Michael Abbott
391712b980 Add support for nearest corner or edge resizing 2012-10-04 09:36:23 +02:00
Mathias Gumz
7b6ab828c7 Improved vertical alignment of text in FbTk::TextButton
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-10-03 10:27:16 +02:00
Mathias Gumz
032a23d1e7 removed duplicate function signature for FbTk::StringUtil::extractNumber() 2012-09-14 08:53:38 +02:00
Mathias Gumz
e512c1becd minor cosmetic 2012-09-14 08:52:13 +02:00
Mathias Gumz
2f279e96b1 Fix regression: switch back to microseconds for DelayCmd 2012-09-14 08:51:42 +02:00
Mathias Gumz
59d097bcea Fix bug: (re)setting timeouts on a running FbTk::Timer might lead to broken 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-09-14 08:48:37 +02:00
Mathias Gumz
541c8c407b changed timing functions to use a monotonic increasing clock
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 45726d3016 and bug #3560509). it is
irrelevant for timers to know the nano-seconds since the epoch anyways.
2012-08-28 10:51:55 +02:00
Peter Hercek
60a53113e0 fix sanity check for transient and explicitly placed windows
When a screen has more heads and some part of the screen is not on any
head and some window is placed into this invisible area then the window
is invisible which sucks. This patch repositions such windows so that
they are visible.
Example:
* head 1 is at (0,120) (size 640x480)
* head 2 is at (480,0) (size 800x600)
* whole screen virtual size is 1440x600
* that means rectangle from (0,0) to (640,120) is not visible on any head
  and any windows placed there would not be visible; for example wireshark
  likes to place dialog boxes at (0,0)
2012-08-22 18:49:09 +02:00
Vladimir A. Pavlov
71f75c70ae Add menu.hilite.font and menu.hilite.justify style resources 2012-08-03 11:37:34 +02:00
Vladimir A. Pavlov
9d25ea54a1 FbTk/ThemeItems.cc: move loading additional font resources to load()
The same logic had been already implemented for texture resources.
2012-08-03 11:37:17 +02:00
Vladimir A. Pavlov
8c50e81e44 FbTk/ThemeItems.cc: don't use style resources in ThemeItem<Font>::setDefaultValue() 2012-08-03 11:37:07 +02:00
Mark Tiefenbruck
2944cd0014 make the menu bit of decoration masks control whether or not menu button is shown on window (it did nothing before) 2012-07-08 17:56:26 -07:00
Mark Tiefenbruck
9eecd58bf3 make alt-tab skip modal windows 2012-07-06 19:30:39 -07:00
Mark Tiefenbruck
610a15ac47 add fullscreen, maximizedhorizontal, and maximizedvertical tests to ClientPattern 2012-07-01 21:22:01 -07:00
Paul Tagliamonte
940fbca3fe removed 'always-true' expression 2012-04-10 09:28:52 +02:00
Paul Tagliamonte
e6a01dcabb use the 'z' modifier for printing 'size_t' like variables 2012-04-10 09:27:44 +02:00
Mathias Gumz
56af5a1635 Bugfix: Don't draw the interlace lines 1px too far 2012-04-10 09:13:04 +02:00
Lajos Koszti
7b6dc2ad72 Allow percentage values for some Window commands 2012-04-06 14:11:16 +02:00
Ryan Pavlik
5d56046b68 FocusableList.cc,.hh: Pass string arguments by const reference.
Found by cppcheck
2012-01-04 07:55:44 +01:00
Ryan Pavlik
85596c1ee2 FbTk/XrmDatabaseHelper.hh: operator== can be const.
Found with cppcheck.
2012-01-04 07:55:17 +01:00
Ryan Pavlik
d70bdbe675 Check .empty() instead of .size() == 0
Found with cppcheck.
2012-01-04 07:54:46 +01:00
Ryan Pavlik
5ae8bdf49d Pre-increment non-primitive types.
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-04 07:53:54 +01:00
Ryan Pavlik
f859e78cb2 Exceptions should be caught by reference.
Found using cppcheck.
2012-01-04 07:51:35 +01:00
Daniel Diaz
db08329d8b Add mwm _MOTIF_WM_INFO atom to advertise mwm hints capability
Applications like urxvt look for the _MOTIF_WM_INFO atom in order
 to know if the window manager implements mwm hints. If this atom
 is not found, then urxvt sets override_redirect when started with
 the borderless option and falls out of the control of Fluxbox.
2012-01-04 07:45:20 +01:00
Paul Tagliamonte
0f994dbb28 No need to check if a pointer is null before de-allocating it.
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."
2012-01-04 07:43:21 +01:00
Ryan Pavlik
ea5f7b56ec src/Makefile.am,FbTk/StringUtil.cc: Search relative to the executable.
On Windows, prepend /DUMMYPREFIX to default paths, and replace it at
runtime with the prefix relative to the exe directory.
2011-10-31 10:54:33 -05:00
Ryan Pavlik
65cb53b685 FbTk/StringUtil.cc: Don't return mid-routine.
Prep for Windows dummy prefix code.
2011-10-31 10:54:33 -05:00
Ryan Pavlik
25d04827b5 main.cc,FbTk/StringUtil.cc: On windows, use USERPROFILE instead of HOME 2011-10-31 10:54:32 -05:00