1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00
Commit Graph

163 Commits

Author SHA1 Message Date
Brad Jorsch
5eebb8bc3c Fix some warnings
Non-obvious fixes:

WINGs/wfilepanel.c: Cast to void to avoid an unused calculated value
warning.

WINGs/wtabview.c: Test tab<0 to avoid a warning from the next condition
about signed overflow in an inlined invocation of the function.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-08 22:00:23 +02:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Brad Jorsch
3490c8bd30 Minor fixes to appicon highlighting
When an app hides its window but doesn't exit (e.g. apps that "minimize"
to the system tray), the highlighting was not being removed.

When alt-tabbing, the tabbed-to app's icon was not getting highlighted.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:31 +02:00
Alexey I. Froloff
392ab2607d Highlite current window's appicon
This patch highlites appicon of a currently focused window.

Original-patch-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-11 17:56:40 +02:00
Alexey I. Froloff
f41db5b5be Add key binding to minimize all windows
MinimizeAllKey - minimize all windows on current workspace.

Original-patch-by: Pavel S. Khmelinsky <hmepas@yauza.ru>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>

[crmafra: AllMinimizeKey --> MinimizeAllKey]
2010-09-11 15:46:24 +02:00
Alexey I. Froloff
aeb4cb8a79 Raise shaded window frame when unhiding
When unhiding window by clicking its appicon, unconditionaly
raise its frame.

Original-patch-by: Artem Delendik <u2u@nm.ru>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-11 15:15:43 +02:00
Carlos R. Mafra
0350b8445a Remove unneeded extern's in .c files
They were not being used in those files, so let's remove them.
2010-04-14 18:39:28 +02:00
Carlos R. Mafra
4041278f48 Address some sparse warnings
Plain integer as NULL pointer, non-ANSI function declaration etc.
2010-04-14 18:39:17 +02:00
Carlos R. Mafra
2ad40e0734 Maximus: Cleanup the code
By defining a struct containing the coordinates of the
windows (top, bottom, left, right, width, height) and
using a helper function to set up these coordinates, the
whole function becomes much cleaner and easier to read.
2010-03-20 18:42:56 +01:00
Carlos R. Mafra
e1d5ce7a51 Cleanup includes of wcore.h, defaults.h and pixmap.h
Several files were including others for no reason, and this slows
down the build time (but probably not measurable on a fast machine).
2010-03-17 11:12:53 +01:00
Carlos R. Mafra
9a2dbc5a5f Fix typos, remove commented out code etc 2010-03-15 19:55:52 +01:00
Carlos R. Mafra
939f46b870 Maximus: Simplify the +/- border width madness
Taking the border width into account was making it hard to follow the
algorithm, and complicating things usually lead to mistakes.

In fact, in trying to account for this +/- 1 pixel issue the maximus
geometry for the requested window would sometimes overlap another window
by one or two pixels (depending if it was on the right or left). Therefore,
applying the maximus geometry to this other window in sequence would
maximize it completely instead of finding the correct tiled geometry.

So that always bugged me. Now I got tired of it and decided to kill the
whole consideration of the border width, and simply put some "+ 1"
inconditionally to be on the safe side.

Now it can happen that the windows will stay away one or two pixels,
but trying to be 'good enough' is better than trying to be 'perfect'
and getting it wrong for corner cases.

And the matter is worse because the size of xterms are 'quantized', so
changing the position of the other windows by a few pixels result sometimes
in a overlap of +1 pixel, or a distance of 1 or 2 pixels. Furthermore,
the bottom of xcalc behaves differently from the bottom of a xterm or
xjed (for xcalc the ad hoc correction for bottom_0 must be -8 in total).

But now my tests show that things are OK, and I can use maximus
for all the windows in the screen and no overlap will occur (except
if one of the windows is a xcalc, I don't know why).
2010-03-15 19:49:32 +01:00
Carlos R. Mafra
ee569220df Remove NEWAPPICON #ifdefs
It wasn't defined anywhere and when I defined it, the compilation
did not finish:

appicon.c: In function drawCorner:
appicon.c:206: error: WScreen has no member named focused_texture
appicon.c:208: error: WScreen has no member named unfocused_texture
appicon.c: At top level:
appicon.c:214: error: conflicting types for drawCorner
appicon.c:193: note: previous definition of drawCorner was here
make[2]: *** [appicon.o] Fehler 1
make[1]: *** [all] Fehler 2
make: *** [all-recursive] Fehler 1

So let's simply remove those #ifdefs.
2010-03-15 17:50:17 +01:00
Carlos R. Mafra
a2133e8e2f Do not change workspace during deiconify animation
Paul Harris reported that using the mouse wheel over a miniwindow
would deiconify it to a different workspace than the original one
where it was iconified.

This happens because after the window begins to be deiconified the
"residual" mouse wheel scrolling hits the workspace background, and
Window Maker changes workspace with wWorkspaceRelativeChange().

But if it all happens fast enough (so the deiconification animation
did not finish yet) the workspace will have changed before the
window reaches its final deiconified destination, leading to
the situation that Paul described in the link below.

So to avoid this, let's set a 'ignore_wks_change' variable
from wDeiconifyWindow() and make wWorkspaceRelativeChange() respect it.

Original report: http://lists.windowmaker.info/dev/msg00821.html
2009-12-26 21:09:10 +01:00
Carlos R. Mafra
33c9e87692 Remove static function declaration from header file 2009-12-09 20:48:44 +01:00
Nicolas Bonifas
41fdb79e28 Maximus: Take border into account
This patch fixes a minor bug in Maximus: the new window size didn't take the
 border into account. This bug was particularly visible with the
 "do not cover dock" option turned on.
2009-12-08 16:14:29 +01:00
Carlos R. Mafra
af8cec15e3 Remove repeated functions enclosed by #if 0
There are already working versions of these functions,
so let's remove these copies.
2009-10-12 01:02:19 +02:00
Carlos R. Mafra
15e37ff942 Remove #ifdef NETWM_HINTS constructs
NETWM_HINT is always defined in src/wconfig.h.in, so
let's remove it from there too.
2009-10-12 01:00:19 +02:00
Carlos R. Mafra
87161c5e0c Remove MINIATURIZE_ANIMATION_DELAY_{Z,F,T} tests
We know that they are non-zero because we set their
values explicitly in wconfig.h.in, so there is no
point in checking them.
2009-10-10 19:30:04 +02:00
Carlos R. Mafra
cda27758bc Add function prototypes in action.h and include it in superfluous.c 2009-10-10 19:29:56 +02:00
Carlos R. Mafra
b014ef2770 Remove 'hiding' parameter from animateResize()
It was a bit pointless.
2009-10-10 19:03:12 +02:00
Carlos R. Mafra
2765bec3e4 Remove sound support
Two reasons for removing it:

    1) I won't ever want to hear useless sounds

    2) The sound support is a bit of a joke. The code is there but you have
       to hunt it somewhere else (not in any repository that I know of).
       In my 10 years of using wmaker, I never used it for this reason.
       Now I consider having no sound in Window Maker a feature, and I like
       it that way. So there is no point in carrying useless code around.

PS: There is still the code in WPrefs to be removed.
2009-10-09 20:04:47 +02:00
Carlos R. Mafra
6a0120f014 Maximus: Some cleanups and bug fixes
Let's ignore hidden windows and also adjust the coordinates
a bit, to avoid ~2 pixels of overlap.

I thank Paul Harris for pointing out these bugs.
2009-09-19 16:07:03 +02:00
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