Commit graph

5970 commits

Author SHA1 Message Date
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
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
6a9c14e620 Update ChangeLog 2015-01-03 18:52:55 +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
74df62b081 Remove unused code / option from FbRun 2015-01-03 18:39:46 +01:00
Mathias Gumz
3e76d43987 Use correct buffer size for number2*() 2015-01-03 18:39:09 +01:00
Mathias Gumz
362b5c191a Identify clang compiler 2015-01-03 17:52:15 +01:00
Mathias Gumz
1a5d52481c Preparation of release 1.3.6 2015-01-03 15:43:33 +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
f5934de61d Recreate man-pages 2015-01-03 14:07:51 +01:00
Mathias Gumz
376ed523cb Update release version 2015-01-03 14:07:34 +01:00
Mathias Gumz
354e59f547 Fix build issue with out-of-src-builds 2015-01-03 14:06:10 +01:00
Mathias Gumz
a3c0b049bf Fix corruption of fbrun-history
This commit fixes issues #72 (brought up + different solution by Mattias
Guns; I received a similar patch by 'Nable 80' via ML and discussed the
issue in #fluxbox with 'Nable 80'), patch #73 (Mattias Guns) and finally
patch #162 (Ulrich Eckhardt; this commit is heavily based upon Ulrich's
work).

The original code was overly complex. It tried to avoid writing
bytes to the disk at the expense of comprehensibility and as a result it
was buggy. I looked at both patches from Mattias and 'Nable 80' which address
the bug with skipping entries in the history-file (my fault: incorrect use
of outfile.ignore(1, '\n')): They provided a proper fix for the problem
but I decided to use Ulrich's code since it improves the whole code by making
it a lot simpler.

So, kudos to all of you.
2015-01-02 17:08:44 +01:00
Mathias Gumz
0e8a27e931 Fix loading fbrun-history
Previous code add one additional entry on loading the history. This
commit is one part of the patch #162 (see [1] and [2]), written
by Ulrich Eckhardt <doomster@knuut.de>.

[1]: https://sourceforge.net/p/fluxbox/patches/162/
[2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fbrun-bug636632.patch;att=1;bug=636632
2015-01-02 16:45:39 +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