Commit graph

4491 commits

Author SHA1 Message Date
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
Ryan Pavlik
b82999c1ac FbTk/FbString.cc,Font.cc: Windows doesn't have nl_langinfo 2011-10-31 10:54:09 -05:00
Ryan Pavlik
d4f682c7bd FbCommands.cc: Implement ExecuteCmd for Windows 2011-10-31 10:54:09 -05:00
Ryan Pavlik
f922d2d803 main.cc: Add a wrapper for two-argument mkdir on Windows 2011-10-31 10:54:09 -05:00
Ryan Pavlik
42f647553a fluxbox.cc: ifdef the signals windows doesn't have. 2011-10-31 10:54:08 -05:00
Ryan Pavlik
b0779c413b FbTk/Timer.cc: Check HAVE_SYS_SELECT_H, add alternate for windows 2011-10-31 10:54:08 -05:00
Ryan Pavlik
5bf23bb05d Merge branches 'fix-out-of-range-memory', 'obey-configure' and 'other-improvements' into windows-mingw 2011-10-31 10:53:05 -05:00
Ryan Pavlik
afa870802b FbTk/App.cc: make startup failure easier to diagnose 2011-10-31 10:51:51 -05:00
Ryan Pavlik
d5b58a8033 main.cc: Use expandFilename for default paths 2011-10-31 10:51:45 -05:00
Ryan Pavlik
7510c2d173 src/Makefile.am: Add warning to defaults.cc as well 2011-10-31 10:51:41 -05:00
Ryan Pavlik
fa63fcdc66 main.cc: Check getenv output better.
Windows returns pointers to empty strings for non-existent env vars.
2011-10-31 10:51:38 -05:00
Ryan Pavlik
75c6cee969 FbTk/FileUtil.cc: Use only file masks defined.
Needed for mingw-cross-env
2011-10-31 10:51:13 -05:00
Ryan Pavlik
cc1193ef0c FbTk/SignalHandler.cc: Use HAVE_SIGACTION, with signal() fallback
This fixes platforms without sigaction, like Windows.
2011-10-31 10:50:26 -05:00
Ryan Pavlik
f40be36f75 FbTk/Timer.cc: Check HAVE_SYS_SELECT_H 2011-10-31 10:47:59 -05:00
Ryan Pavlik
757f78035d FbTk/StringUtil.cc: Fix out-of-range memory access.
if pos is not npos, it will always be less than filename.size().
However, the access later is only safe if there is a character
after pos, which would require pos + 1 to be less than filename.size.
2011-10-31 10:44:11 -05:00
Ryan Pavlik
60c964a4d9 RootTheme.cc: Obey HAVE_SYS_WAIT_H 2011-10-31 10:42:08 -05:00
Ryan Pavlik
4bad431c90 main.cc: Only sync() if we can. 2011-10-31 10:42:06 -05:00
Ryan Pavlik
c944c8c0b3 fluxbox.cc: check HAVE_SYS_WAIT_H 2011-10-31 10:42:00 -05:00
Ryan Pavlik
f47ed1be51 FbTk/I18n.cc: Constructor should also check defined(NLS) 2011-10-31 10:41:32 -05:00
Mathias Gumz
fe0eda27bd bugfix: use the imlib cache for every imlib context used
calling imlib_set_cache_size() before a context is created by fluxbox creates
an 'unknown' context. that one is never freed at shutdown.
2011-10-23 11:58:32 +02:00
Mathias Gumz
a545ddef17 clean up imlib2 loaders at shutdown 2011-10-23 11:52:05 +02:00
Mathias Gumz
2628a0a4cf clean up resources on shutdown 2011-10-23 11:51:36 +02:00
Mathias Gumz
dc18666ef2 small code simplification 2011-10-23 09:01:19 +02:00
Mathias Gumz
ee34b376d7 Bugfix: clean up static resources correctly
93924af160 might corrupt memory with gcc-4.6.1 when
finishing fluxbox (clicking 'exit', sending it a SIGINT). Allthough the order, in which static / global
objects are initialized is undefined (at least between separate compilation units), the order in
which they are destroyed is well defined: in reverse order of initialization.

this means, that if 'ScreenImlibContextContainer contexts' (of ImageImlib2.cc)
gets initialized AFTER 'ImageImlib2 imlib2_loader' of Image.cc, it gets destroyed before
imlib2_loader. When that happens, ~ImageImlib2() works on a destroyed object.

(That lead to '* glibc detected * fluxbox: corrupted double-linked list: 0x0000000000dd2710 ***'
later on in 'iconv_close')
2011-10-23 00:01:45 +02:00
Mathias Gumz
3f76e117bf refactored MenuCreator
make public only what needs to be public
2011-10-21 08:42:48 +02:00
Gediminas Liktaras
12f44680df Added support for ARGB visual, patch #3284774
fluxbox now properly displays windows that require ARGB visuals when
an external compositor is running. This was done by creating the
container window with the correct visual and colormap when needed.

Closes #2874629
2011-10-20 09:41:55 +02:00
Mathias Gumz
a2558a2b14 removed obsolete handler for the gnome-window manager hints
nowadays every app should use the extended window manager hints exclusively.
2011-10-17 17:07:00 +02:00
Pavel Labath
0e1ee49603 Fix compilation with intel's compiler
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-09-14 19:39:11 +02:00
Pavel Labath
e54bca68d2 Make sure FocusableList disconnects from signals when it is destroyed 2011-09-14 19:39:11 +02:00
Pavel Labath
aa84c95253 Enable connecting to const Signals
The idea is that connecting to a signal doesn't change it's state or the state of the object
owning the signal (even though it needs to add the functor to the list for later reference).
Emitting, on the other hand, is usually done as a result of a state change and therefore remains
non-const.

Additional benefit of this arrangement is that objects can export const references to signals to
allow connecting, while keeping the ability to emit to themselves.
2011-09-14 19:39:11 +02:00
Pavel Labath
3c050c3d99 Add explicit ReturnType cast to operator() of FbTk::Slots
without this it wasn't possible to construct a Slot returning void from functors returning some
real value because the compiler would complain about "return statement with a value in a function
returning void".

Theoretically, this may produce some unexpected type conversions, because static_cast is slightly
stronger than implicit cast, but I judge the risk to be negligable (the alternative would be to
provide explicit specializations for slots returning void - too much typing)
2011-09-14 19:39:11 +02:00
Pavel Labath
e67b9a6f83 Upgrade FbTk::Timer so it can take an arbitrary functor as a parameter 2011-09-14 19:39:11 +02:00
Pavel Labath
ae252c62cb Rename Signal::connect function taking an already-constructed slot to connectSlot
I do this to avoid compiler ambiguity between the two versions of connect()
2011-09-14 19:39:11 +02:00
Pavel Labath
05b5974e62 Add comparison operators to FbTk::RefCount
without them, gcc would compare them by converting them to bool first, which is not exactly what
one would expect. Frankly, I'm surprised it even worked without this.
2011-09-14 19:39:11 +02:00
Pavel Labath
536a16e6e2 Use RefCount to store keybindings
I'm doing this because I want to have access to keybindings from lua and for that I need more
flexible ownership semantics.
2011-09-14 19:39:11 +02:00
Pavel Labath
d21ceb4a23 Remove the assignment operator from a regular pointer to a RefCount
it is too easy too shoot yourself in the foot with it, other smart pointers also don't allow such
assignments. If you do want to assign to a RefCount pointer, use reset().
ps: assignment between two RefCounts remains possible, of course.
2011-09-14 19:39:11 +02:00
Pavel Labath
1f34dee9b3 Remove obsolete code
ps: it was already commented out, I'm just deleting it
2011-09-14 19:39:10 +02:00
Pavel Labath
2e75d238ab add FbTk::makeRef function, for easier construction of RefCount pointers 2011-09-14 19:39:10 +02:00
Pavel Labath
cfcc4d44aa FbTk::Timer accepts Slots instead of Commands as the former are more general 2011-09-14 19:39:10 +02:00
Pavel Labath
d338e6c003 Signal::connect now also accepts an already-constructed Slot
This way we can use Commands as signal handlers out-of-the-box.
2011-09-14 19:39:10 +02:00
Pavel Labath
bca20c5db4 Make FbTk::Command inherit from FbTk::Slot
Command offers a subset of functionality and could be completely removed at some point.
2011-09-14 19:39:10 +02:00
Pavel Labath
3ad611928a Fix a small bug in BScreen constructor
it was testing for FbWindow.property() == Success, where it should've tested for == true.
2011-09-14 19:39:10 +02:00
Pavel Labath
e4157821fc Add a reset() function to FbTk::RefCount
to make it's interface more compatible with other smart pointers.
2011-09-14 19:39:10 +02:00
Pavel Labath
0f85ade9be Mark FbTk::StringConvertor as NotCopyable 2011-09-14 19:39:10 +02:00
Pavel Labath
7bca844581 Prepare the Slot classes to be used independently of Signals
Added some polish around them and, to mark this special occasion, moved them out of the SigImpl
namespace.

PS: This partially reverts commit 0775350fee, since I had to
reintroduce ReturnType template parameter, because it will be used in other places. But Signal classes
remain without the ReturnType, because I still cannot imagine how would it be used.
2011-09-14 19:39:10 +02:00
Pavel Labath
0a40d1caf3 Add template copy constructor to FbTk::Refcount
and remove a an "almost" copy constructor (almost, because it takes a non-const reference
parameter) which was useless.
2011-09-14 19:39:10 +02:00
Peter Korsgaard
b9e9eb4e44 FbString: fix build without iconv
Commit 690d926 (introduced FbTk::BidiString) broke building without
HAVE_ICONV, because of wrong variable name and use of iconv_t type.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-11 17:18:30 +02:00
Mathias Gumz
f9df3ffeda sync the copied config files to disk before continuing
otherwise a race condition might appear between copying the default
config files to .fluxbox/ and executing 'fluxbox-update_configs'. under
macosx this lead to 'fluxbox hangs'.
2011-09-10 20:17:57 +02:00
Mathias Gumz
6c82cd5f84 bugfix: do not change workspaces when using NextWindow / PrevWindow buttons in toolbar 2011-09-01 17:08:50 +02:00
Mathias Gumz
0708d1e046 regrab ButtonMotionMask as well (needed for 'Move' events in keysfile) 2011-08-26 09:22:37 +02:00
Mathias Gumz
ec6df5c3d1 bugfix: remap keysyms to keycodes after 'MappingNotify', fix #3386257
setxkbmap and xmodmap both might change the keycodes. thus fluxbox needs
to remap the keysyms from the currently loaded keytree to new keycodes
after it received a 'MappingNotify' event.

we do not reload() the keys file because:

* the user might work on it right now
* remap only needed symbols is cheaper than parsing the keysfile anyway
2011-08-26 09:21:50 +02:00
Mathias Gumz
1da473bab9 Use _NET_WM_ICON from 32bit apps (xfce4-terminal) correctly
The icons coming from _NET_WM_ICON are argb32. fluxbox uses such icons
in entities such as 'clientmenu', 'iconbar', 'titlebar'. These entities
are not related to the depth of the winclient but to fluxbox's default
depth. Using 'winclient.depth()' is a mistake, since fluxbox is unable
to copy pixmaps from 32bit to 24/16/15bit.

It is not necessary either, because fluxbox should extract the argb32 icon
data directly into the pixmap with the correct depth in the first place.

This fixes (reopened) bug #1852693.

Note: The whole icon code in fluxbox is quite messy, lots of copying and
scaling. It might be simpler and fater to just extract the icon when needed
, in just the size that is needed.
2011-08-11 09:48:08 +02:00
nacitar sevaht
822c02e96a TextDialog now handles parentrelative labels
Prior to this patch, TextDialog did not handle parentrelative labels;
borrowing code from OSDWindow, now TextDialog properly handles this.

Eventually, I plan to combine the good parts of TextDialog and OSDWindow
into OSDWindow, and then let TextDialog derive from OSDWindow... but for
now, here's the band-aid fix for the issue without the refactorization.
2011-05-16 22:09:57 +02:00
nacitar sevaht
fd6fbb80e7 TextDialog and ToolTipWindow style rendering bugs fixed
TextDialog windows (such as 'set title', or 'edit clock format') now
properly render their titlebar to match the current style.  Previously,
the titlebar font settings were controlled by window.font.*, and this
became apparent because window.font.effect needed to be set to put
'halo' on the titlebar of these TextDialogs.  However,
window.font.effect controls the effect on the text within the editbox on
these as well, having these set in the same location is far from
desirable.  Specifically because the TextDialog essentially emulates the
titlebar of other windows.  So, after this change, window.font.effect
still controls the text in the editbox, but the titlebar area is themed
as the titlebars of other windows.

Text justification of titlebar and border width, is now respected in
TextDialog.  Also, previously the edit box was sized in an odd way; one
which left part of the window actually undrawn (so you'd get artifacts
from whatever happened to be on the screen in that position when it
opened); this has been addressed.

TextDialogs, rather than going to the center of the entire desktop, now
center on the _current head_, which prevents the awful positioning where
half of the window is on one screen and half is on another.

Lastly, when hovering your mouse over the iconbar button for a window
with a title that's too wide to fit on the button, a tooltip is
displayed.  This tooltip themes itself to match the button, however it
wasn't using the theme properly (similarly to how TextDialog was)... and
as such, also wasn't using the proper font effects.  This has been
addressed just as it was for the TextDialog.
2011-05-16 20:03:02 +02:00
Pavel Labath
16c90dc19f Make SignalTracker always disconnect itself from Signals
previously, the tracker disconnected itself only when the caller passed withTracker = true to the
leave() function. However, the default value was for the parameter was false.

Non disconnecting from signal when stopping tracking creates very dangerous situation because the
signal still holds a pointer to the tracker. This resulted in a segfault when exiting fluxbox,
because the tracker (FluxboxWindow) got destroyed before the signal (BScreen::focusedWindowSig),
and the signal was using an invalid pointer when it tried to disconnect itself from the tracker.

Instead of setting withTracker to true by default or changing all invocations of leave(), I
decided to make the tracker disconnect itself unconditionally because I could not find a use case
for the opposite behaviour.

PS: This message is in fact longer than the actual commit.
2011-05-10 13:00:46 +02:00
Pavel Labath
7525ca9f77 Remove all trace of Observers and Subjects
this marks the completion of the transition to FbTk::Signal
2011-05-10 13:00:46 +02:00
Pavel Labath
57acca0b60 Convert ToolbarItem::resizeSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
79d526b968 Convert Screen::reconfigureSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
e1b0decf55 Convert Focusable::attentionSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
2073ae12a4 Convert FbWinFrame::frameExtentSig to FbTk::Signal
Also, I spotted a potential bug in the code. I marked the place with XXX. Someone should take a
look at that.
2011-05-10 13:00:46 +02:00
Pavel Labath
ff49160b12 Convert FluxboxWindow::hintSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
6a0280aa4d Convert FluxboxWindow::layerSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
e53d14e910 Convert FluxboxWindow::stateSig to FbTk::Signal 2011-05-10 13:00:46 +02:00
Pavel Labath
ad0951ca53 Remove Observers from testSignal.cc 2011-05-10 13:00:46 +02:00
Pavel Labath
4f89009c9e Convert FluxboxWindow::workspaceSig to FbTk::Signal 2011-05-10 13:00:45 +02:00
Pavel Labath
ae68b7f7cd Convert Focusable::orderSig,addSig,removeSig,resetSig to FbTk::Signal 2011-05-10 13:00:45 +02:00
Pavel Labath
19ac8e40d8 Added FbTk::MemFunBind - a functor which binds all arguments of a function 2011-05-10 13:00:45 +02:00
Pavel Labath
6cfa087536 Make FbTk::MemFun[12] inherit from std::unary/binary_function
this way, they can be used as inputs to std::bind1st and friends
2011-05-10 13:00:45 +02:00
Pavel Labath
2024f258b6 Make FbTk::MemFun[0-3] use their ResultType parameter
previously they declared the parameter, but ignored the return value of the member function. I've
changed it so they pass the return value, if it is not void. MemFunSelectArg didn't have the
ReturnType template parameter, so I added it for consistency. Since I was already editing the, I
made all the operator()s const.
2011-05-10 13:00:45 +02:00
Pavel Labath
129bac1e0f Convert Focusable::dieSig to FbTk::Signal 2011-05-10 13:00:45 +02:00
Pavel Labath
0775350fee Last round of simplification of Signal/Slot classes
- merged all the common stuff from 0,1,2,3 argument versions into one common base class
- removed ReturnType template parameter as it was instantiated with "void" everywhere and the
  current ignores the return value of the callbacks anyway
2011-05-10 13:00:45 +02:00
Pavel Labath
bef2039d2c Don't crash when a slot is deregistered in the middle of signal processing
this was possible (and used) with FbTk::Subject, but the implemetation of FbTk::Signal didn't
support it, which made it impossible to continue with conversion.
2011-05-10 13:00:45 +02:00
Pavel Labath
144d716a42 Simplify Slot.hh
Replace CallbackHolder, FunctorHolder and SlotHolder with a (smaller) set of polymorphic classes.
SignalHolder now stores a (smart) pointer to the class.
2011-05-10 13:00:45 +02:00
Pavel Labath
4b47675441 Make RefCount<> more sensible
the previous version of operator*() made no sense. E.g., it violated the invariant
(*ptr).foo <=> ptr->foo. The dereferencing operator now returns a reference to the pointed-to
object, rather than a pointer to it.

I also added a bool conversion operator, which can be used in testing the NULL-ness of the
pointer. Anyone wondering if that could be done in a simpler way is encouraged to read
<http://www.artima.com/cppsource/safebool.html>.

And, finally, I removed the mutable flag from the m_data member, since it does not need it.
2011-05-10 13:00:45 +02:00
Pavel Labath
fa15400cc2 Remove the Observer dependency from FbTk::Menu 2011-05-10 13:00:45 +02:00
Pavel Labath
f7d7dfd2a8 Convert FbTk::Theme::reconfigSig and friends to the new Signal system
I removed the const versions of reconfigSig() in the process since FbTk::Signal has no const
methods anyway.
2011-05-10 13:00:45 +02:00
Pavel Labath
54230c9a44 Simplify FbTk::Signal template classes a bit
basically, i just got rid of Signal[0-3] classes and moved their contents to the appropriate
specialization of FbTk::Signal

also, this fixes the
no matching function for call to 'MemFunIgnoreArgs(FbTk::Signal<void, FbTk::SigImpl::EmptyArg,
FbTk::SigImpl::EmptyArg, FbTk::SigImpl::EmptyArg>&, void (FbTk::SigImpl::Signal0<void>::*)())'
error i had in the following commit.
2011-05-10 13:00:44 +02:00
nacitar sevaht
1dacf57d20 Can check CARDINAL properties in CLIENT PATTERNS
Introduces a new member function, FbWindow::cardinalProperty()

This change also changes other code that previously used
FbWindow::property() to do the same thing as the new function; this
reduces code duplication.

There are still some bits of code (Ewmh.cc, extractNetWmIcon()) that use
FbWindow::property() to retrieve XA_CARDINAL values, but as the new
method is designed for getting a _single_ property, and that code uses
FbWindow::property() to retrieve the number of values present, and then
grab all of them; it's a different use case.  I opted to not try to make
cardinalProperty() into some monolithic all-purpose cardinal method;
FbWindow::property() works just fine for that.

This change also adds an optional (default=NULL) boolean to
FbWindow::textProperty and friends that allows the caller to determine
whether or not a value was actually retrieved.  This was necessary for
integrating FbWindow::cardinalProperty with the codebase, and it seemed
to fit with FbWindow::textProperty as well.  Prior to this change, if
you got a return value of "", you wouldn't know if you successfully
retrieved the value which happened to be blank, or if you failed to
retrieve the value.  Now, you can pass the address of a boolean if you
so choose in order to differentiate these situations; the same applies
to the new FbWindow::cardinalProperty().
2011-05-08 07:48:03 +02:00
Pavel Labath
de2cca8988 Include src/tests in the distribution tarball
and add a configure option for building them (default: off).
This patch fixes an error when configuring the tarball, where configure complained it cannot find
src/tests/Makefile.in.
2011-05-07 12:39:04 +02:00
Pavel Labath
38b678e4cb Make sure `make distcheck' is successful
- added rmdir commands to uninstall rules of all Makefiles under data/styles
- added \n at the end of files which had none
2011-04-27 12:10:12 +02:00
Mathias Gumz
be90145227 bugfix: do not warp workspaces with only one workspace 2011-04-25 11:33:20 +02:00
Pavel Labath
86c9b100f3 Fix VPATH builds 2011-04-18 08:50:44 +02:00
Pavel Labath
8b6943ab1c Fix a couple of "comparison between signed and unsigned" warnings 2011-04-15 21:36:04 +02:00
David Coppa
870d4d02ee bugfix: use 'unsigned long' to feed XChangeProperty, closes #3285968
old code crashed on sparc64, pid_t seems to be 32bit on that platform.
2011-04-14 15:08:02 +02:00
Pavel Labath
a83cedf37e Fix a pair of warnings reported by clang 2011-04-11 08:37:58 +02:00
Pavel Labath
91958279d3 Menu.cc: send debug output to cerr, make the output more sensible 2011-04-11 08:31:52 +02:00
Gediminas Liktaras
b1d70e2c92 bugfix: return 'height' if container is rotated vertically, closes #3195728
iconbar.iconWidth property was ignored due this bug.
2011-04-03 13:20:35 +02:00
Daniel Diaz
d28e105075 compile fix: added <cstdlib> to provide declaration for 'size_t' (gcc-4.6.x likes it that way) 2011-03-28 09:06:22 +02:00
Mathias Gumz
d4f7f17330 compile fix: arguments must match declaration
Sun CC++ 5.11 complaint on linking about missing symbols 'nextWorkspace()',
'prevWorkspace()' etc.
2011-03-23 18:45:34 +01:00
Mathias Gumz
745fb8e71c removed useless code 2011-03-23 18:41:48 +01:00
Mathias Gumz
21022a1952 cosmetics 2011-03-23 12:03:17 +01:00
Mathias Gumz
9086ccafbe compile fix: sunCC again, wants a compile time constant for arrays 2011-03-23 12:03:08 +01:00
Mathias Gumz
e850b01919 compile fix: sunCC 5.11 (sunstudio 12) compiles and links again
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-03-23 12:02:15 +01:00
Mathias Gumz
7ece90ad4f merge 2011-03-19 20:12:05 +01:00
Mathias Gumz
9f2c37341c code cleanup: moved code from public API to implementation
renamed 'Region' to 'Area' to avoid conflicts with 'Region' from Xlib.
2011-03-19 19:29:43 +01:00
Henrik Kinnunen
0b6c860fa0 delete config menu first at shutdown 2011-03-19 19:19:26 +01:00
Mathias Gumz
97e08c3853 bugfix: reposition windows only if they are invisible
changing the layout or the number of the attached monitors
might lead to invisible windows. only those windows should be
positioned to the closest monitor, if they are not visible
already.
2011-03-19 15:05:39 +01:00
Mathias Gumz
c200045e9a code deduplication: use RectangleUtil::insideBorder() 2011-03-19 15:01:16 +01:00
Mathias Gumz
767afd32f3 prepare BScreen::XineramaHeadInfo to be 'RectangleLike' 2011-03-19 15:00:34 +01:00
Mathias Gumz
a798e0e0ff added RectangleUtil::overlapRectangles() + test cases 2011-03-19 14:56:45 +01:00
Mathias Gumz
bcae4e257d added tests/testRectangleUtil.cc 2011-03-18 17:57:34 +01:00