If we compute the maximus geometry in only one pass through
the window list, the order in which the windows appear in
the list can affect the outcome.
That is because before computing the intersections in the
y-projections we update the y coordinates from whatever window
which happened to change the new_y coordinate during the
previous x-intersection computations, but that may not be _the_
blocking window which decides the final positions in the y axis.
Therefore we may find that this "intermediate window state"
has a non-vanishing y-intersection with another one -- and
be blocked by it -- even though that should not be the case for
the final outcome.
So to avoid that we first scan through all the windows to decide
the final maximumized coordinates in the y axis. Only after that we
compute the x-coordinates.
When maximumizing a window which has the full_maximize attribute
set we have to consider two possibilities:
1. If the new y coordinate is zero it means that no other
window blocked its maximumization up to the top of the
screen, so we want to put the titlebar outside.
2. If the new y coordinate is not zero it means that another
window in the current workspace blocked its way to y = 0.
In this case we do nothing with the titlebar.
Note that there is another possible fine tunning which is not
addressed in this patch, which is to consider the resize bar.
Let's avoid checking the existence of a border every time
we want to adjust the widths. So we'll always subtract the correction
factor, which is zero in case the window has no border.
If the old_geometry coordinates were saved while the window
was in another xinerama head, use current coordinates as
the old ones to avoid making the window jump heads when
un-maximizing it.
With this patch, minimized windows do not reshuffle anymore.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=361241
where Martin Hinsch reported:
"The behaviour of icons (minimized applications) is severely broken when
automatic placement is switched on.
* When switching the workspace icons often stick thereby covering (and
hiding) icons on the workspace one is switching to.
* After minimizing an application, clicking (singly or doubly) on one of
the icons causes all of them to reshuffle, usually in a way that the
icon in question changes its place (which is extremely annoying).
* Icon placement ignores the dock so that icons disappear behind
it/cover it.
All of these suddenly appeared about a year ago (I think with 91.0). The
problems are not architecture-specific since they occur in exactly the
same way on my pentium machine. Wiping the complete configuration (rm -r
~/GNUstep) did not make a change either."
We should not try to un-maximize the windows from inside
the function wMaximizeWindow(), as that makes no sense.
If the window is already maximized then we don't call
wMaximizeWindow() anymore and call wUnmaximizeWindow()
instead, which will use the old geometry regardless
of which maximization is active (horizontal, vertical,
maximus, etc). And the old geometry now is also saved
when we enter wMaximizeWindow().
So when we call wMaximizeWindow() or wUnmaximizeWindow()
we really mean "maximize to the specified state" or
"go back to whatever old geometry coordinates we had before".
This patch introduces the "tiled maximization" feature, a.k.a. Maximus.
By pressing the keyboard shortcut associated with Maximus, the focused
window will be maximized to the greatest area satisfying the constraint
of not overlapping existing windows.
Moved the half_scr_width calculation to after the
usableArea = wGetUsableAreaForHead(scr, head, &totalArea, True);
call. This fixes the problem where windows that get "half screen
maximized" cover the dock or clip.
Instead of open coding the animation routines in the function bodies,
put them in a helper function called shade_animate(wwin, what), whose
second argument can be SHADE or UNSHADE.
This adds Left Half / Right Half Maximize capability to WindowMaker.
It allows you to maximize a window to only the left or right half
of your screen.
It is useful on widescreen displays where one might to bring up
two different windows side-by-side.
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)
A minor bug has been bothering me for a long time. When you maximize a
borderless window in Window Maker, the window ends up too narrow and too short
by two pixels.
Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
Pedro Gimeno explains:
"As you most likely already know, every X Window event comes with a
timestamp. You can see it using e.g. xev.
I don't know if this is Debian-specific and I'm no X Window expert, but
the fact is that in my machine this timestamp, according to my
/usr/include/X11/X.h, is a 32-bit unsigned integer and it holds the
event time in milliseconds according to my tests.
This timestamp appears to be in milliseconds from the start of the Unix
epoch, modulo 2^32. The problem is that 32 bits are too little for this
purpose: 2^32 milliseconds are exactly 49 days, 17 hours, 2 minutes and
47.296 seconds.
Now, the WindowMaker code rejects any focus event whose timestamp is
less than the last one seen, using code similar to this:
if (timestamp < LastTimeStamp) return;
LastTimeStamp = timestamp;
This is a disaster when timestamp wraps around because of the 32-bit
limit. Say LastTimeStamp equals 2^32-1 and a focus event comes two
milliseconds after. Its timestamp will equal 1 because of the
wraparound. Obviously, 1 < 2^32-1 so the event will be rejected even if
it comes from the future (relative to LastTimeStamp) and not from the
past. Focus events are no longer accepted because nothing can be greater
than 2^32-1 (unless you click on that exact millisecond, 49 days after).
If you look in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314
you'll see two people confirming the periodicity and predictability of
the bug. Arnaud Giersch was who noted that the period was 2^32
milliseconds (and not 2^31 as I thought it could be because of a signed
int involved) and who noted the coincidence with the Unix epoch.
My fix works by subtracting one timestamp from the other (an operation
which is done modulo 2^32) and rejecting the focus event only if the new
timestamp is within 1 minute (60000 milliseconds) in the past. Given the
periodicity of the timestamp, actually after 49.7 days there will be
another minute in the future during which focus events will not be
accepted; again after 99.4 days, etc., but thanks to the subtraction,
they will now be relative to the *last* focus change and not to the Unix
epoch.
The patch could be simplified to get rid of the compareTimes function.
It's written like that because it comes from the previous patch (which
you can see in the same bug report).
So the date comparison line could end up looking like this:
if (scr->flags.ignore_focus_events || LastFocusChange - timestamp <
60000)
so you can get rid of the compareTimes function. However please respect
the other change of 'int' to 'Time'.
As for why you aren't experiencing this problem, perhaps the event
timestamp does not come from the Unix epoch in your X Window system, but
rather starts counting when you start it or your computer, I don't know.
Or maybe your X Window server's timestamps are 64 bits wide instead of
32 bits, which I don't think because I doubt the X11 protocol specifies
a 64-bit record for the transmission of the timestamp. In either case,
the output of xev will probably help understanding the cause.
Or maybe even it's a click-to-focus only bug and you're not using that
mode. I haven't checked who calls wSetFocusTo.
Note that I can reproduce it just by manipulating the system clock,
which seems to be tied to the event timestamps."
For more information see:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314
Reported-by: Joey Hess <joeyh@debian.org>
Signed-off-by: Pedro Gimeno <parigalo@formauri.es>
belong to, that works without auto-arranging the icons, while still avoiding
multiple icons in the same spot by moving the miniwindows to a new slot if
their old slot was occupied in the meantime.
- double clicking an appicon will also raise the miniwindows that belong to
that application to the front (along with the normal windows).
- Fixed bug in icon chooser dialog that could cause a segmentation fault
in some cases (Pascal Hofstee <caelian@gmail.com>)
- Fixed crash in asm code in wrlib, with new versions of gcc.
- Fixed bug in the x86_PseudoColor_32_to_8() function which incorrectly
used the r, g, b fields in the conversion.
- Fixed x86 ASM code in wrlib to work on 64 bit architectures.
- Fixed the focus flicker seen with some apps (notably gtk2)
(Alexey Spiridonov <snarkmaster@gmail.com>)
- Fixed all crashing bugs that were generated by wmaker starting with the
WMState file missing.
- Added NetWM support (a modified version of the patch originaly written
by Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied patch to enhance the Virtual Desktop behaviour, and to integrate
it with the NetWM code (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied a few xinerama and placement fixes (Peter Zijlstra
<a.p.zijlstra@chello.nl>)
- Fixed memory leak in dock code.
- Fixed and enhanced the text wrapping in WINGs.
- Fixed the layout of some elements in WPrefs.app
- Added workaround for aplications that don't set the required hints on the
client leader window, but they set them on normal windows (observer with
KDE 3.3.0 mainly). This will allow these apps to get an appicon again.
(they should be fixed still)
- Added workaround for applications that do not set a command with
XSetCommand(), but instead they set the _NET_WM_PID property. This works
with operating systems that offer a /proc interface similar to what linux
has. (This also is to fix problems with KDE 3.3.0 apps, but not only them).
- Fixed bug with autostart and exit scripts not being executed if user
GNUstep path was different from ~/GNUstep (when setting GNUSTEP_USER_ROOT)
- Added utf8 support in WINGs (removed old X core font code)
- Added utility to convert old font names to new font names in style files
maximizing to support succesive maximizations in different directions
without the need to do an intermediary un-maximize step (eliminates flicker)
- Made keyboard/mouse maximization behavior consinstent relative to each other
- Made maximizing behaves differently with keyboard/mouse for xinerama
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- A few leftover xinerama fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Extended the 'strut' to multiple heads
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon placement now takes into account the new xinerama extended 'strut'
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon arrangement that takes the new extended xinerama 'strut' into account
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
the incorrect window got focus instead of the apps's last focused window)
- Unshade application's shaded windows when Dbl-MiddleClick-ing its appicon.
(this is to be consistent with deminiaturizing application's miniwindows
which also happens in this case, since shading is a form of miniaturization)
- misc fixes
WindowMaker 0.80 crashes (SIGSEGV) on deiconifying the miniwindow of
Mozilla 0.98, under following condition. - running ATOK X for Linux *
- create new Mozilla Window
- using ATOK on Mozilla (make "mozilla-im-status" window visible)
- Fixed Legal Panel not to display rectangles in place of new lines.
- Removed some obsoleted/unused files from cvs
- Fixed a bug with Sloppy focus when changing workspaces (from a debian user
bug report/patch)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
shell/xterm or from the main menu, if there is a docked appicon of that
class that is not running at the time the app is launched.
- Added animation to show that the appicon was stolen by the dock (the way
NEXTSTEP did - map an appicon as it normally would have been, then slide it
to the position the docked appicon is).
- Updated the animation constants for scrolling/sliding/shading to better
adapt to newer/faster machines. Also used wusleep(10) when the delay was 0
to get rid of the jerky animation when there was no delay.
internal code clean-up with notifications for window state change and other
stuff, also cleaned kde and gnome support in preparation for wm-spec support..