Commit graph

5970 commits

Author SHA1 Message Date
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
Mathias Gumz
121bd23862 move shared build instructions for nls into a common file 2014-02-19 18:13:27 +01: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
Peter Pentchev
58472fea6d Fix the Bulgarian translation's codeset.
The codeset of the Bulgarian translation was incorrectly specified as
ISO-8859-1 instead of CP1251.  This led to incorrect transcoding to
UTF-8 and the display of wrong characters in the Fluxbox menu.
2014-02-19 17:31:00 +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
Isratine Citizen
3ad6e299f6 update hebrew translation 2013-08-02 08:41:57 +02:00
Takeshi Hamasaki
99a8ebbf6f Updated Japanese Translation 2013-08-02 08:40:28 +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
Paul Tagliamonte
34656ac622 Returning EXIT_FAILURE on exit in fluxbox-remote. 2013-06-18 18:02:38 +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
82e300c7ba build-sys: use iconv library detections from gettext
This patch took copy of config.rpath from gettext 0.18.2 to build-aux/
directory.  Software projects usually does not need to do that, because
the file is copied by gettext autopoint in autogen.sh or bootstrap.

In Fluxbox case calling autopoint seems wrong, as it would generate po/
directory with necessary make automation, adn 'msgid' & 'msgstr' files,
but that is not how the translations are done in this project.
2013-05-26 10:38:11 +01:00
Sami Kerola
bc205a9b32 build-sys: unify configure.ac syntax 2013-05-26 10:38:11 +01:00
Sami Kerola
74c414a89f build-sys: add test programs to .gitinore file 2013-05-26 10:38:10 +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
22ddf8fd36 build-sys: move autotools files to subdirectories 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
Sami Kerola
f5bfd27f52 docs: update Doxyfile
Just a simple 'doxygen -u' version update.
2013-05-26 10:38:09 +01:00
Sami Kerola
468ca6813d build-sys: remove unnecessary files 2013-05-26 10:38:09 +01:00
Sami Kerola
95a3c57a7d build-sys: use automake subdir-object 2013-05-26 10:38:09 +01:00
skizzhg
1f24e6decd Removing a blank line in nls/it_IT/Translation.m that breaks the -help output. 2013-05-24 06:39:47 +02: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
20c46d94d4 mpf 2013-02-13 11:06:21 +01:00
Mathias Gumz
b023c124a8 Updated Changelog, NEWS, man-pages for 1.3.5 2013-02-13 11:00:22 +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
fe2d9476d5 Updated Changelog, NEWS, man-pages for 1.3.4 2013-02-10 17:09:04 +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