Commit graph

5917 commits

Author SHA1 Message Date
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
Paul Tagliamonte
b104d9e4d0 Rebuilding the fluxbox docs to change fix a small grammer mistake
Fluxbox's man page had "allows to", which should actually be something like
 "allows one to".

 The rest of the .ins were rebuilt as a result. No changes otherwise.
2011-09-02 04:57:28 +02:00
Sven Michel
631fd58823 Re-licensing the ostrich theme due to issues regarding it's distribution
CC-BY-NC 3.0 is a great license, but it limits how well we can redistribute
 the theme it's self. This change allows distros (such as Debian) to keep this
 theme in the source.
2011-09-01 20:51:14 +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
Sven Michel
7b10649e28 Updated styles 'bloe' and 'arch' to look better without xpm-support 2011-08-11 09:58:19 +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
Pavel Labath
d5bd23e41a Fix make install failure with some autotools versions
apparently, some versions of autotools don't know about $(builddir) variable. I replaced it with
".".
2011-05-09 19:51:11 +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
nacitar sevaht
2f166eb4ae fluxbox-remote now properly returns exit status
The previous check relied upon the (undocumented) return value of
XChangeProperty to determine the exit status; at least, on my gentoo system,
the function seems to return 1 even when it fails to change the property
due to contrived, and invalid, parameters.  However, setting an error
handler allows proper detection of this case.  So, now the return status
properly indicates whether or not the property was changed (but not
whether fluxbox liked the command!).
2011-05-08 07:47:02 +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
127ec08ae6 Fix "comparison between signed and unsigned" warning 2011-05-04 20:33:07 +02:00
Pavel Labath
7618494341 Add backup and vim swap files to .gitignore 2011-05-04 20:32:43 +02:00
Pavel Labath
55ee0b72a3 Woops, forgot to add the file. 2011-04-27 14:17:07 +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
1237f83207 fixed typo in 'MerleyKay' style, closes #3286430 2011-04-14 15:10:28 +02:00