1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00
Commit Graph

190 Commits

Author SHA1 Message Date
Carlos R. Mafra
0a0c2391de Maximus: Avoid a window list order issue
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.
2009-09-19 16:06:48 +02:00
Carlos R. Mafra
92eff967a7 Maximus: Consider the full_maximize window attribute
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.
2009-09-17 00:46:14 +02:00
Carlos R. Mafra
eaca92db50 Simplify wMaximizeWindow() a little bit
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.
2009-09-17 00:46:14 +02:00
Nicolas Bonifas
cf0f7d68d5 Un-maximize window inside current head
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.
2009-09-13 23:33:39 +02:00
Nicolas Bonifas
3106292f4b Maximus: Use unsigned int for width/height variables
And move its prototype to actions.h (and also that of
save_old_geometry()).
2009-09-13 23:32:15 +02:00
BERTRAND Joel
816fee1b68 Fix miniwindows auto-arranging bug
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."
2009-09-11 10:24:54 +02:00
Carlos R. Mafra
c04a2caeab Clean up maximization and un-maximization logic
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".
2009-09-02 04:42:19 +02:00
Carlos R. Mafra
cf62d1591f Maximus: Tiled Maximization
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.
2009-09-02 04:42:05 +02:00
klaasvakie
2ed9c12ee5 Fix half_scr_width calculation
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.
2009-09-01 13:57:58 +02:00
Carlos R. Mafra
229b6984de Use half_scr_width instead of computing it each time
Let's use

    half_scr_width = (usableArea.x2 - usableArea.x1)/2;

to shorten the expressions in the left/right half maximize
code.
2009-08-30 16:28:23 +02:00
Carlos R. Mafra
a1f35d7f5b Increase the readability of wUnshadeWindow() and wShadeWindow() a little bit
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.
2009-08-30 00:58:18 +02:00
Johann Haarhoff
6924454836 Left Half / Right Half Maximize
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.
2009-08-29 21:49:16 +02:00
Carlos R. Mafra
688a56e8ab Change to the linux kernel coding style
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 :-)
2009-08-20 00:59:40 +02:00
David Benbennick
3e9aae7a91 Fix mixing pixels when maximizing borderless windows
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>
2009-08-15 23:59:45 +02:00
Pedro Gimeno
c91bb1ba13 Fix periodic focus bug
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>
2008-06-26 15:03:38 -03:00
dan
4e8423d18a Fixed segfault when unhiding an application in certain conditions (seen
with KDE applications with transient windows)
2006-04-27 19:16:58 +00:00
dan
c0317ddae5 eliminated gcc-4 compilation warnings 2005-08-22 23:58:19 +00:00
dan
ad0ae4887f - new algorithm for placing miniwindows after unhiding the application they
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).
2005-07-03 17:37:03 +00:00
dan
ad641c1992 Fixed issue with GNUstep applications losing focus when all their windows
are closed and there remains only their menu (Matt Rice <ratmice@yahoo.com>)
2005-07-02 19:23:41 +00:00
dan
69730273b1 - fixed bug with windows shrinking to very small sizes when Unmaximize was
used on them, after they were closed in a maximized state.
- fixed bug with restoring maximized state from NetWM atoms.
2005-05-15 16:45:02 +00:00
dan
2ea40ff2c5 Improved hide/unhide animation for applications with multiple windows
(only animate the active window hiding/unhiding, which makes Window Maker
faster and more responsive for such applications).
2005-05-08 00:51:56 +00:00
kojima
620a280d64 code review 2004-10-22 23:39:11 +00:00
dan
0c09179f01 - Removed support for legacy systems: OpenLook, KDE-2.x, Gnome-1.x
- Removed #define and #ifdef XFT constructs, as XFT is on all the time
2004-10-14 23:05:20 +00:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +00:00
dan
9aca0d5f6e - Check whether libXft is at least version 2.1.2 else refuse to compile.
- 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
2004-10-12 01:34:32 +00:00
dan
0852957ea1 update before moving to xft2 2003-08-06 23:58:54 +00:00
dan
7efcf57c18 fixed the 'focus flicker' problem, seen with GTK2 applications 2003-08-03 00:00:11 +00:00
dan
8457611316 fixes to comply to ANSI C 2003-07-16 20:58:49 +00:00
dan
bd7943d9a7 - Implemented a better logic to preserve the window's old geometry when
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
2003-07-05 02:39:37 +00:00
dan
396b011610 Fixed bug with focusing a deminiaturized window with sloppy focus mode 2003-06-14 21:13:34 +00:00
dan
27a396d7ed - Fixed sloppy focus bug
- 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>)
2003-06-06 04:11:00 +00:00
kojima
5dbb770aa4 xinerama stuff for solaris 2003-06-04 18:57:03 +00:00
dan
fdeb749da7 Autoarrange icons after unhiding an application that has miniaturized
windows, else they may cover other icons which are now in the positions
they have occupied before hiding
2003-02-27 07:42:46 +00:00
dan
fe4cd695af - Fixed a bug with deminiaturizing windows when the application is hidden and
the miniaturized window is selected from the window list menu
2003-02-24 04:06:20 +00:00
dan
b381674375 - Fixed incorrect focusing of application's windows after an unhide (sometimes
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
2003-02-11 00:32:17 +00:00
dan
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
kojima
a10214a502 - Fixed sloppy focus bug (Pawel S. Veselov <pv76716@druid.SFBay.Sun.COM>)
- Applied Xinerama patch (after fixes) from (Peter Zijlstra
  <a.p.zijlstra@chello.nl>)
2002-11-28 22:04:07 +00:00
kojima
579eb01c6c applied patch from Ryosuke Nanba <rna@cyber.email.ne.jp>
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)
2002-05-25 03:01:32 +00:00
kojima
5873385d32 fix for soemthing wrong with piped menus 2002-02-15 21:30:42 +00:00
dan
501c3f48b8 - Fixed labels not to display '\n' as a character if multiple '\n' are passed
- 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)
2002-01-05 01:35:30 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- 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
2002-01-04 07:32:37 +00:00
dan
a8c7375623 Fixed problem with kcalc not having a miniaturize button 2002-01-04 00:30:11 +00:00
dan
6f28d987a8 - Fixed problem with unhiding taht mapped windows from other workspaces
on the current workspace.
- Made apps with an application menu not to use a shared appicon.
2001-12-18 16:10:07 +00:00
dan
f4ef34b814 - Made dock/clip steal appicons of applications that were started from a
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.
2001-12-17 21:21:59 +00:00
dan
672c42cc48 - removed the collapse appicons thing
- added real appicon sharing (apps of the same kind will have a single
  shared appicon).
2001-12-17 04:02:33 +00:00
dan
0c4dc1c24a - Deminiaturizing a window that is also shaded, will perform an unshade too.
(Note that this only applies to deminiaturizing shaded windows.
   Unhiding an application will keep the shaded/unshaded state of windows.)
2001-11-20 13:48:23 +00:00
kojima
5ef342d905 fixed bug in positioning of window list menu when opened by kbd
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..
2001-09-06 21:42:28 +00:00
kojima
fa994f627e fixed crash bug with WM_CLASS==NULL
etc
2001-08-20 18:11:40 +00:00
kojima
7e1f0e1e48 fixed [joeyh@debian.org: Bug#99311: full screen maximization cuts off bottom 6 pixels] 2001-06-06 18:20:23 +00:00
kojima
205b3f35b9 removed FocusFollowMouse 2001-05-14 14:58:55 +00:00