Commit graph

6131 commits

Author SHA1 Message Date
Thomas Lübking
fe8ff87292 add autoraising to toolbar and slit 2016-08-26 08:06:47 +02:00
Thomas Lübking
6c0565c482 add commands to toggle toolbar and slit layer
toggle(Toolbar|Slit)Above toggles the resp. item between its
regular and the AboveDock layer (ie. above everything, even visible on
active fullscreen windows)

Also required step for autoraising.

REQUEST: 222
2016-08-26 08:06:47 +02:00
Thomas Lübking
f22435d60b add support for artificial struts (per head)
Allows to maintain access to desktop fractions etc. against
maximized windows. Also permits to OnToolbar clicks in this case, eg. to
raise it.

REQUEST: 150
2016-08-26 08:06:47 +02:00
Thomas Lübking
3bde5c8aee Improve stretching (RELATIVE) toolbar items
The available space is distributed reg. the preferred width
of items (spacers and the iconbar ;-) instead of evenly.

The preferred width of the iconbar is calculated from its buttons.

This allows to align the iconbar using spacers and makes better use of
the available space
2016-08-26 07:33:44 +02:00
Thomas Lübking
10e3f10b55 Adjust RELATIVE ::repositionItems (more relative)
The evenly distributed space causes a lot of whitespace and otoh. cut
items, so we use the items internal size as indicator IF the item is a
textbutton (the regular usecase in fluxbox)

Also publish the function to be triggered from outside (because the
caller can, in theory, much better compress several text changes)
2016-08-06 17:09:30 +02:00
Thomas Lübking
cc80230bd8 expose a preferredWidth of *Button's 2016-08-06 17:09:30 +02:00
Thomas Lübking
59d9b0703b delay title updates
Notably shells will cause brief interim titles when calling
short-lived commands (try "ls"...)
This covers such by waiting 100ms after every title update before
reacting (the title will have returned in the mentioned cases, the UI
remains steady)
2016-08-06 17:09:29 +02:00
Thomas Lübking
a8b0b3632b signal title changes
so that interested parties (the iconbar ;-) can use/forward them
2016-08-06 17:09:29 +02:00
Thomas Lübking
f6e1f555f9 Add SpacerTool
This allows to add random spacers, fixed size or stretching, to the toolbar.

CCBUG: 1141
2016-08-06 17:09:05 +02:00
Thomas Lübking
50b6102bbf flag slit for reconfiguration and act on show
According to Peter Ganzhorn, there's a transparency issue when using an
autohiding slit, but I don't use a slit at all.
However, the explanations in the bug do make sense and this is just an
alternative approach on the problem (that does not require interim
showing)

BUG: 1132
2016-07-30 18:38:28 +02:00
Thomas Lübking
dc226902a7 fix transient dialog placement
dialogs can be bigger than the mainwindow and the unsigned dimensions
then overflow in the subtraction (the window would still be moved into
screen bounds but appear on ugly 0,0)
2016-07-30 18:38:28 +02:00
Thomas Lübking
58491165d3 hide window before restoring the client on unmaps
otherwise compositors will update the texture and operate on (fade) the
frame instead of the client.
Didn't test why this only happens on ARGBs, but could be the colormap
installation.

BUG: 1110
2016-07-30 18:27:21 +02:00
Thomas Lübking
5e08a23f6c reposition visible submenus when changing style
a fixed position of the style menu won't help (the menu geometry changes
*because* the item geometries do) - warping the pointer would likely be
possible, but warping the pointer is cc. "evil"

BUG: 715
2016-07-30 18:22:49 +02:00
Thomas Lübking
bccb185cd9 reconfigTheme's on loading a new style
Also reconfigure menus (recursively) on style load
The most critical call is the shape update - the menus often become
cut-off, preventing mouse interaction with lower items, but also colors
are not applied correctly to menus w/o updating them.

BUG 1022 is most likely this and only a misinterpretation (for the
mentioned items are those with lacking color updates on style updates)

BUG: 1146
BUG: 1017
CCBUG: 1022
2016-07-30 18:22:49 +02:00
Thomas Lübking
6defd9391d handle both Focusable's as m_cycling_next
m_cycling_next can either be WinClient or a FluxboxWindow
In case of the latter, client->fbwindow() needs to be matched in
setFocusedWindow when protecting against client side focus juggling.

BUG: 1148
2016-07-30 15:10:21 +02:00
Thomas Lübking
f6132b7602 explicitly set s_focusedWindow for cycle protection 2016-07-30 15:10:21 +02:00
Thomas Lübking
87c0182ea5 Do not reset cycle focus when unsetting focus only 2016-07-30 15:10:21 +02:00
Thomas Lübking
635f14e5c9 Do not protect focus while cycling
We've better things to do and the focus is moving around anyway
BUG: 1048
2016-07-30 15:10:21 +02:00
Thomas Lübking
2758485d35 do not lock focus against unfocusing.
Latter happens when eg. closing windows, including such with
locked focus
2016-07-30 15:10:20 +02:00
Thomas Lübking
34bf7d31c4 prefer m_cycling_next over s_focused_window
as cycle start (former is where we wanted to go and X11 is still async)
2016-07-30 15:08:41 +02:00
Thomas Lübking
4bc08709f1 allow to force moveResize and use on applyState
applyState also requires some updates implied by moveResize, notably the
reconfigure, the setBackground on the window etcetc.
Instead of testing what'd be missing from a moveResize, we just force
the latter to apply even when seeming unrequired.

This has notable impact when switching fullscreen state for a window
with fullscreen dimensions.

BUG: 992
2016-07-30 11:22:24 +02:00
Thomas Lübking
baaf477d46 add support for dedicated completion data
This allows to complete random things, useful along the -print flag but
also to limit the commands to those found my menumaker etc.
2016-07-23 16:58:04 +02:00
Thomas Lübking
8094f4d1a9 Allow to center fbrun
While any window can be centered using the apps file, fbrun can serve many
purposes and sometimes (runner) makes sense being centered, sometimes
(button/menu triggered input) near the mouse, sometimes ("application")
regularily placed.

REQUEST: 282
2016-07-23 16:58:04 +02:00
Thomas Lübking
0ca5daf997 limit fbrun history size
the default is 1024-1025, values are read from the FBRUN_HISTORY_SIZE
environment variable
NOTICE: the limit isn't hard, but will typically be n+1 and only n if
the new entry is already present in the last n entries

REQUEST: 202
2016-07-23 16:58:04 +02:00
Thomas Lübking
e85dc01d28 add autocompletion support to fbrun 2016-07-23 16:58:04 +02:00
Thomas Lübking
d741b6fe6e improve fbrun completion
- streamline code
- indicate completion by making use of selection
- fix buggy behavior (notably subsequent completions and FS path
  following)
- support "~" in paths
- support chunk completion
  (ie. "mp[layer] ~/vid[eos/favporn.mp4]" can be completed in both
   tokens; buggy with paths including spaces in non-leafs)

REQUEST: 223
2016-07-23 16:58:04 +02:00
Thomas Lübking
ed75e883db clear selection on text input
Entering upcase chars would auto-select them
Seems I don't need upcase chars very often ;-)
2016-07-23 16:58:04 +02:00
Thomas Lübking
69756527d5 list strict mouse focus in FOCUS POLICY section
of man 1 fluxbox.

BUG: 950
2016-07-03 09:35:41 +02:00
Thomas Lübking
7525226fe2 less bashisms in fluxbox-generate_menu
still works with bash or zsh, but fish (now) complains about "cat << EOF" ...

no "grep -q"
BUG: 961

echo is troublesome
POSIX doesn't know a "local" keyword
BUG: 975

seems double comments ## aren't supported everywhere
BUG: 1057
2016-07-03 09:30:51 +02:00
Thomas Lübking
abd5c9e478 smart handling of NotifyUngrab crossing events
closing a keyboard driven popup had the sideeffect to return the focus
where the pointer is, regardless of whether that window had the focus
before (due to a NotifyUngrab crossing event), bug #597
This was resolved by simply ignoring NotifyUngrab mode crossings, but
that had the unfortunate sideeffects to break focus passing when the
mouse was actually moved (in a DnD operation, 730) or the focus shall be
passed on for strict mouse focus and a mouse triggered lower action (1012)

So instead we record the window that was last entered by a *real*
crossing and only ignore the NotifyUngrab event if this window didn't
change.

BUG: 1012
BUG: 730
CCBUG: 597
2016-07-03 09:29:07 +02:00
Thomas Lübking
848875eb92 Revert "bugfix: fbsetroot needs to use 24bit visuals as well"
This reverts commit 4f4d5e25d9.

The patch resolved a problem introduced by the ::setDepth abuse in
FbRootWindow, but this fails if the root window is *really* 32bit
With commit dcdde4d, the broken workaround depth selection is no longer
required.

BUG: 1093
2016-07-02 05:36:34 +02:00
Thomas Lübking
b6f620597b document "transient" section
BUG: 1092
2016-07-02 05:35:49 +02:00
Thomas Lübking
ca452a5886 ignore font for empty title height calculation
and align calculation on init and reconfigure

As a result, if a menu has no label, the title height is determined
only by menu.titleHeight (and the border sizes), not by the unused font.
2016-07-01 20:14:04 +02:00
Thomas Lübking
ea306493f9 re-fix alt+tab'bing through tabbed windows
commit 98313bf broke (i'm terribly sorry) this because m_cycling_last stores
the first client in a tabgroup, thus cannot be abused for this purpose.
So we explicitly store a value and btw. do it before sending the focus,
ie. "in time" for sure instead of "for sure™"
2016-07-01 19:42:28 +02:00
Thomas Lübking
e85cf49035 fix tabbing of unfocusable clients
this affects all java clients, because java uses the retarded
WM_TAKE_FOCUS protocol, but also very important clients like xeyes ;-)

BUG: 1055
2016-07-01 19:42:22 +02:00
Thomas Lübking
2aba567ea6 do not leave stale oplock behind
deiconify'ing a client on a different workspace left an oplock by a
shortcut return, turning the client semi- to inaccessible

BUG: 1010
2016-07-01 19:42:14 +02:00
Thomas Lübking
9d34cdbfa9 avoid calling into XLib
Testing one bug, the function seems usually be called with the root
window as parameter, so we can save a pointless lookup for the root of
the root by testing against window before testing against window_root.

Elegantly, this will "fix" the bug where XGetGeometry of the second
heads root will either report the first heads root or some junk (xephyr
case?)

BUG: 1128
2016-07-01 19:41:59 +02:00
Thomas Lübking
9dccccb84d ensure to update the current client tab from menu
the menu focuses which tries to set the current tab, but fails because
the iconified client won't have the input focus (yet), so we pass it a
dedicated "set this client and do not try to set input because we're
going to do next anyway explicitly" call =)

BUG: 997
2016-07-01 19:41:16 +02:00
Thomas Lübking
0951134ced do not move unfocused windows to the desktop layer
While usually™ the window is just reset to its original layer, ensuring
to show the active window is certainly a good idea, but it's not
required to lower the fullscreen window to the desktop layer, the other
windows layer + an extra raise is entirely sufficient and it's rather
odd to see conky when activating a utility window to a video player ;-)

CCBUG: 894
2016-07-01 19:40:55 +02:00
Thomas Lübking
666e7b0337 add _NET_WM_NAME to FbWindow::setName
since fluxbox is a f**** WM it should be able to use f**** NETWM hints
in its toolkit ;-)

CCBUG: 702
(does not fix input)
2016-07-01 19:40:47 +02:00
Thomas Lübking
475e966f19 fix tab selection by mousepress
Tabs outside the titlebar are not selectable by mouseclicks (ie. the
feature does not work)
The patch clones the enterNotifyEvent code and ignores (for now) the
actual button (no idea whether it makes any sense to restrict it the
left button?)

BUG: 1103
2016-07-01 19:40:34 +02:00
Thomas Lübking
6907dc2c23 document FocusProtection feature 2016-06-26 16:35:37 +02:00
Thomas Lübking
07d8fbfba8 merge remember focusnew into focusprotection
The FocusNewWindow key is still read, but not written and OVERRIDDEN in
case of conflict with the FocusProtection key
2016-06-26 16:35:26 +02:00
Thomas Lübking
1a61881ec3 Add FocusProtection features
The apps file gets a new key
FocusProtection
supporting a comma separated list.
* None : regular behavior
* Lock : If this window has the focus, no other may claim it
* Deny : This window is not allowed to focus itself

I addition there's preparation for a follow-up patch to incorporate and
substitute the present FocusNewWindow feature:
* Gain : Pass focus to new window
* Refuse : Do not pass focus to new window

rationale:
clients stealing the focus sucks badly and while there's an input driven
timeout, that only protects actual typing flow, but if eg. vlc proceeds on
the playlist, you'll suddenly control vlc instead of your browser
(ie. typing ctrl+w doesn't close the tab, but the playlist ...)
2016-06-26 16:35:16 +02:00
Thomas Lübking
69b0f0fa97 remove strut when property is withdrawn
CCBUG: 1133
2016-06-26 16:31:37 +02:00
Thomas Lübking
bfe4737427 fix tracking of MWM hints in case of removal 2016-06-26 16:31:22 +02:00
Thomas Lübking
dcdde4d32c replace FbRootWindow::depth with maxDepth
The depth member of FbWindow was abused to store the maximum depth
but that gets overridden with geometry changes of the root window
(screen layout changes) so we store and read the value explicitly while
::depth() maintains the actual depth of the root window

The result of this is that frames for ARGB windows were created with a
wrong depth and failed to reparent the client window.

BUG: 1102
BUG: 1058
2016-06-26 16:29:34 +02:00
Thomas Lübking
484c33bf25 prevent clients from positioning out of workspace
Still enough stupid ones around which ask for 0,0
(despite there's a panel ...) or restore a position
on a VGA screen which they stored while being on a 4k
screen.

Otoh, do not forcefully position the window just because
the topleft position is outside any head, this can still
be desired and isn't a problem.
Actually, the corner could be covered by the close button
and if *only* it is onscreen the window can hardly by used
or seen.
2016-06-26 16:21:02 +02:00
Thomas Lübking
6201286cdf keep cmd menus off struts when the mouse is in it
the mouse is likely the trigger, so the popup would cover the
trigger item.
The present behavior of the iconbar suggests such behavior is
desired.
2016-06-26 16:16:04 +02:00
Mathias Gumz
b9ed1c16de improve consistency
for a std::string::size_type, the right value to use is not "-1", but
std::string::npos.
2016-05-28 16:57:43 +02:00