Commit graph

5956 commits

Author SHA1 Message Date
Daniel Campbell
fc245408d6 Fix printf bug in fluxbox-generate_menu 2015-01-25 13:37:31 +01:00
Mathias Gumz
6721c7c70b Add 'lxterminal' and 'geany' to fbgm
Implements #305 (feature request "Recognize lxterminal and geany
(fluxbox-generate_menu)"
2015-01-24 19:17:02 +01:00
Mathias Gumz
e650b34d20 Update Changelog; prepare 1.3.7 2015-01-24 10:49:19 +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
73858632f3 Update manpage to reflect -no-slit and -no-toolbar 2015-01-22 16:41:19 +01:00
Mathias Gumz
bf3714e124 Update translations to reflect new flags via -h 2015-01-22 16:30:57 +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
3cda1099e2 Prepare 1.3.7 2015-01-22 10:50:02 +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
ad8e6da8ef Make coverity happy
Coverity complaints about 'isdigit(whole_keyfile[pos])' is changing the
validity of 'keyfile' (which itself is just a copy of whole_keyfile.c_str()).

This might be a valid claim, it might be not. By using the 'keyfile'
variable we make Coverity happy and achieve the same behavior.
2015-01-16 10:45:39 +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
b4cd455490 Fix broken formatting 2015-01-14 07:27:19 +01:00
Mathias Gumz
0ff9c83579 Fix 'configure --help' to match actual default value 2015-01-11 09:33:44 +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
a46a4aef08 Documentation: white-spaces and minor formatting 2015-01-05 16:52:06 +01:00
Mathias Gumz
3d6d7f8183 Add ArrangeWindowsStack* actions to vim-keys 2015-01-05 16:49:16 +01:00
Mathias Gumz
d9f3a73b38 Fix build-system: link against libiconv
Some systems (BSD, MacOSX) need explicit linkage against -liconv.
2015-01-05 16:10:05 +01:00