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

1654 Commits

Author SHA1 Message Date
Sebastien Bauer
f8dd3dc49e Add option to allow starting DockApps with a single click
This patch is from the contrib directory. It adds an option to allow starting
DockApps with a single click. It's a handy option that adds only a few lines to
the code.

It is a good feature patch example because it includes modifications
to the WPrefs application so that the feature can be easily enabled or
disabled. The one-click ability allows wmaker to integrate more seemlessly with
programs like ROX-Filer which can be configured to use single or double click
actions.

The README in the contrib/ directory says,

author:
Sebastien Bauer <seb_bauer@bigfoot.com>
John Morrissey <jwm@horde.net>

updated for Window Maker 0.65.0 by:
Daniel Richard G. <skunk@graphics.lcs.mit.edu>

updated for Window Maker 0.80.2 by:
Martial Daumas <martial@nasgaia.org>

update for 0.80.2+ by:
steve lion <steve.lion@verizon.net> and vlaad
2009-09-03 15:19:10 +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
Daniel Déchelotte
7857f297ea Fix for omnipresent AppIcon bug at startup
Bug overview: right after start up, omnipresent AppIcons (living in the Clip)
    are displayed but non-functionnal.

    How to reproduce it: place two AppIcons in the Clip, make the first one (A)
    omnipresent and leave the second one (B) as is. Make the Clip "autocollapse".
    Switch to the second workspace and restart wmaker. Wmaker starts in the first
    workspace; the Clip is closed (its text color corresponds to the closed state,
    AppIcon B is not shown). However, AppIcon A is displayed.  Moreover, A does
    not react when the Clip expands or collapses.  Finally, a click on A makes it
    disappear. Fortunately, changing to another workspace fixes the problem
    definitively.

    Explanation and correction: internally, wmaker maintains as many clips as
    workspaces. When the user switches to another workspace, the omnipresent
    AppIcons are moved to the new "current" clip. In the situation above (trying
    to reproduce the bug), when wmaker restarts, the omnipresent AppIcons are
    restored in the second workspace, whereas the first workspace is active. In
    the previous code, a "hack" (calling XMapWindow()) unconditionally displayed
    the omnipresent AppIcons. The proposed patch makes sure the omnipresent
    AppIcons are moved to the first workspace on wmaker startup.
2009-09-02 00:17:27 +02:00
Tamas TEVESZ
b37e065252 Clean up #ifdef mess
Use enum instead of #ifdef maze for enumerating keybindings
2009-09-01 14:31:08 +02:00
Daniel Déchelotte
d7183d33b4 Gobble "spurious" EnterNotify events when moving an appIcon or a dock
This is a bug fix. Bug overview: if an AppIcon is moved rapidly over a Clip
    set to auto-expand, the latter may erroneously auto-expand afterwards.

    How to reproduce it: set a Clip to auto-collapse, and make sure it contains a
    (random) AppIcon, so as to easily visualise its open/close state. Now move
    rapidly an AppIcon over the Clip. Try to move it so fast that the cursor
    sometimes is out of the AppIcon's tile. Then, replace the AppIcon out of the
    Clip.

    Explanation and correction: if, while the AppIcon was being moved, the mouse
    cursor entered at least once in the Clip's tile, the latter is going to
    receive an EnterNotify event (after the AppIcon is replaced) and thus expand
    automatically after the relevant delay. The solution is to simply "gobble"
    (i.e., ignore) all EnterNotify events when moving an AppIcon.
2009-09-01 14:12:55 +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
Carlos R. Mafra
34be9d7816 Trivial coding style changes
Some trivial style changes I made while reading src/placement.c
2009-08-30 00:51:27 +02:00
Tamas TEVESZ
9af6316d1d k&r->ansi some stuff
ansify and "fix" function pointer declarations
2009-08-29 21:49:22 +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
328251c68a Define TITLEBAR_HEIGHT in default configuration file
...and use it in src/placement.c

And while we are at it, clean up a bit the visual of wconfig.h.in
2009-08-28 21:21:03 +02:00
Carlos R. Mafra
2f87d01a41 Make wmaker 0.11% smaller by avoiding code duplication
This patch cleans up an obvious code duplication case in the
different "placement" algorithms.

Avoid this needless repetition by using a helper function,
which in turn lets those functions a bit easier to read and
also makes wmaker 0.11% smaller :-)

[mafra@Pilar:wmaker.git]$ size src/.libs/wmaker.*
   text    data     bss     dec     hex filename
 619824   19160    8544  647528   9e168 src/.libs/wmaker.new
 620552   19160    8544  648256   9e440 src/.libs/wmaker.old
2009-08-28 20:18:18 +02:00
Martin Dietze
22730876e4 Nightly Build script can now deal with testing and unstable branches. 2009-08-28 19:04:29 +02:00
Gilbert Ashley
be08535ab4 Show app name in Kill Application dialog
The "Kill Application" dialog window doesn't always show the
application name when killing DockApps. It shows its wm_class
instead, which is not always the same as the app name.

This patch allows the Kill Application dialog window to show
the application name in the window -- as expressed by using the
basename of the path to the application.

[crmafra: Added wtokensplit() to get only the app name]
2009-08-27 16:35:42 +02:00
Vladimir Nadvornik
108127f0b5 Miscellaneous fixes from OpenSuse
These are some of the fixes sent to the wmaker-dev list by
Vladimir Nadvornik, with minor modifications to address Dan
Pascu's concerns.

Original-post: http://lists.windowmaker.info/dev/msg00293.html
2009-08-27 16:34:44 +02:00
Carlos R. Mafra
6d75291e1d Add config option to supress focus requests across workspaces
In commit d6c134f420 ("Do not switch
workspace to follow new windows in others") the default behavior
was changed, and workspace switching to follow focus requests was
strictly forbidden.

Although that seems to be a sane thing to do by default, that raises
concerns about whether Window Maker could be more flexible in that
respect -- allowing the user to choose which applications are or
are not allowed to do that.

This patch adds such configuration, located in the "Advanced Options"
submenu of the top-level "Attributes" menu.
2009-08-26 17:53:08 +02:00
Martin Dietze
ca60620f50 Adapted nightly build script to coexist with new 'next' branch. 2009-08-26 15:51:13 +02:00
Martin Dietze
a9aeefbe70 Fix NULL pointer dereference
Some weird applications like Safari for Windows running on CXOffice
or some applications running on Wine were causing wmaker to crash.
So let's not rely on a window's `frame' property to be not NULL in
src/wmspec.c.

Original-post: http://lists.windowmaker.info/dev/msg00161.html
See-also: http://lists.windowmaker.info/dev/msg00222.html
2009-08-25 01:10:00 +02:00
Martin Dietze
d6c134f420 Do not switch workspace to follow new windows in others
New windows should only be focused if they are in the current workspace.
Not performing this check can lead to WM switching workspaces if a
window is opened which:

   (a) is configured to appear in a particular workspace

and

   (b) sends a _NET_ACTIVE_WINDOW message to give focus to
       something, e.g. a sub window.

This behaviour was observed with firefox if a session with more
than one tab open was restored at startup because:

 "If a Client wants to activate another window, it MUST send a
   _NET_ACTIVE_WINDOW client message to the root window:"

Original-post: http://lists.windowmaker.info/dev/msg00442.html

[crmafra: Added comment]
2009-08-25 00:47:37 +02:00
Martin Dietze
442e3876c6 Add debianisation code and automatic build script 2009-08-24 11:55:20 +02:00
Martin Dietze
19f110d26e Add two menu files from the Debian package 2009-08-24 11:55:20 +02:00
Martin Dietze
3f6ae395ce Add GLOBAL_DEFAULTS_SUBDIR and fix a syntax error in wmlib/Makefile.am 2009-08-24 11:55:20 +02:00
Martin Dietze
ba027149bd Up the version number for the GIT version to 0.93.0-pre wmaker-0.93.0-crm 2009-08-24 11:55:20 +02:00
Tamas TEVESZ
f893728d2d Fix format strings 2009-08-23 21:10:02 +02:00
Alexey Voinov
01dddf00c8 swpanel: Consider also the release of FOCUSPREV
The switch panel was not being destroyed with the realease of
FOCUSPREV, only with FOCUSNEXT. Fix this.

One can reproduce this bug as follows.

In the "Keyboard Shortcut Preferences" of WPrefs set "Focus next window"
to e.g. "Alt+Tab" and "Focus previous window" to "Ctrl+Tab".
The switchpanel is not destroyed if we release "Ctrl+Tab" but it
is upon releasing of "Alt+Tab".

Retrieved-from: http://git.altlinux.org/people/voins/packages/?p=WindowMaker.git;a=commit;h=51c95a55c9310f499b1fdeca138106ca7bf74423

[crmafra: Commit log]
2009-08-23 20:03:21 +02:00
Carlos R. Mafra
fe736e849c Remove LITE config option
Why?

     1. The reason for its existence is to "Disable some stuff that are
        duplicated in kde", and I don't think I will ever need that.
        Furthermore, even the description in the configure script reads
        "disable some stuff (dont use it)".

     2. It makes the code uglier at some places, e.g.,

         #ifdef LITE
                {
         #if 0
                }
         #endif
         #else

                if (!wRootMenuPerformShortcut(event)) {
         #endif

        which by the way is the ugliness which motivated this patch.

     3. Does not even compile anymore. It fails with

          CC dockedapp.o
          CC event.o
       event.c: In function 'executeButtonAction:
       event.c:711: error: WScreen has no member named root_menu
       event.c:712: error: WScreen has no member named root_menu
       event.c:713: error: WScreen has no member named root_menu
       event.c:715: error: WScreen has no member named root_menu
       event.c:720: error: WScreen has no member named switch_menu
       event.c:721: error: WScreen has no member named switch_menu
       event.c:722: error: WScreen has no member named switch_menu
       event.c:724: error: WScreen has no member named switch_menu
       make[2]: *** [event.o] Error 1
       make[1]: *** [all] Error 2
       make: *** [all-recursive] Error 1

       But instead of fixing this (it would be trivial), let's get
       rid of the whole ugliness altogether.
2009-08-23 18:45:30 +02:00
Carlos R. Mafra
874b0fadf5 Add spaces to gcc 'case' range extension
According to the gcc manual, that is safer.
2009-08-23 17:28:04 +02:00
Carlos R. Mafra
31f16389f6 Fix function prototype declaration
It is safer if the functions are declared with proper
prototype specifications.

This patch addresses some of the warnings with -Wstrict-prototype,
like this:

event.c:105: warning: function declaration isn't a prototype
2009-08-23 15:15:29 +02:00
Pedro Martelletto
2706f7217c WPrefs: Fix crash due to wtokenfree() memory leak fix
After the fix to avoid a memory leak in wtokenfree(), WPrefs crashes
when opening the 'Applications Menu Definition' dialogue.

The problem is that WPrefs code relied on the fact that the first token
in the array would not be free'd by wtokenfree(), a misbehaviour which
is correctly addressed with this patch.

Retrieved-from: http://www.mail-archive.com/ports@openbsd.org/msg12731.html

[crmafra: small changes in the commit log from the webpage]
2009-08-22 20:51:47 +02:00
Tobias Stoeckmann
e522ca734d WINGs: Fix memory leak in wtokenfree()
wtokenfree() does not free the first entry of an array.
If count is 1 then

   while (--count)

will be

   while (0)

and the inner body of that while-loop will not be entered.
Therefore a memory leak happens every time wtokenfree() is called.

Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/patches/

[crmafra: This patch, altough correct, breaks WPrefs.app, which will be
fixed by the next patch. ]
2009-08-22 20:40:27 +02:00
Nicolas Bonifas
3a0eb643d9 swpanel: Start with the first window when all are minimized
When all windows are minimized, the switch panel cursor is
initially on the second window in the list. With this patch
it will be on the first window.
2009-08-22 13:03:56 +02:00
Carlos R. Mafra
f79379c090 swpanel: Fix stacking issue with swpanel escape handling
Daniel Déchelotte reported one problem with the escape handling in
the switchpanel:

   "Start with two windows: a fullscreen one, and a smaller window
    that appears above the fullscreen one. With the mouse, focus the
    bigger window. Start alt-tabbing, then press Escape. The bigger
    window will then be focused (good) *and raised* (small problem)."

Fix this by adding a test for the escape key before calling
raiseWindow().
2009-08-22 03:08:05 +02:00
Carlos R. Mafra
001bc28037 swpanel: Factor out if (swpanel) test
We can remove redundand tests in each "case:" inside the
switch if we do it in the beginning.
2009-08-22 03:08:05 +02:00
Carlos R. Mafra
203eba8937 swpanel: Clean up "case ButtonRelease"
Get rid of 2 tabs indentation by removing a
not-strictly-necessary temporary variable.
2009-08-22 03:08:05 +02:00
Carlos R. Mafra
d27e43e6b5 swpanel: Clean up StartWindozeCycle() a bit more
We can put the test for 'newFocused' inside change_focus_and_raise()
to clean up the code a little bit.
2009-08-22 03:07:34 +02:00
Tobias Stoeckmann
1db15a3543 Fix multiple errors in findfile.c
Problems:

1.

  During expansion of path, the resulting path can overflow the supplied
  area of PATH_MAX+2 (buffer as well as buffer2). A tampered environment
  variable can be used to modify program flow.

Proof:
      [note: wmaker has been compiled with propolice]
      $ export A="[tested with 4096x A]"
      $ GNUSTEP_USER_ROOT="\$A\$A/\$A/\$A/" wmaker --for-real
      *** stack smashing detected ***: wmaker terminated
      Aborted

2.

  Way too many functions handle a return value of NULL for wexpandpath
  improperly, resulting in segfaults (and maybe other problems). To
  prove the existance of these issues:

Proof:
      $ GNUSTEP_USER_ROOT=~nouser wmaker --for-real
      wmaker error: could not get password entry for user nouser: Success
      Segmentation fault

Solution:

     hard exit with error message about what is going on.

3.

  The improper parsing of environment variables can lead to expansion
  of path names that were not intended to be expanded.

     (a) If a string like "$(var" is found, Window Maker tries to expand "var"
     	 (environment variable) although the syntax is wrong.

Proof:

      $ export PROOF=foo
      $ GNUSTEP_USER_ROOT=/\$\(PROOF wmaker --for-real
      wmaker warning: could not find user GNUstep directory (/foo/Defaults/WindowMaker).

      (b) If the variable out of a) cannot be resolved, a closing bracket will be
      	  added.

Proof:

      $ unset PROOF
      $ GNUSTEP_USER_ROOT=/\$\(PROOF wmaker --for-real
      ./wmaker warning: could not find user GNUstep directory ($(PROOF)/Defaults/WindowMaker).

Author: Tobias Stoeckmann
Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/
Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
2009-08-21 12:13:12 +02:00
Daniel Déchelotte
c970c94f82 Remove useless tests
There is no point in checking

      if (dock_state)

if the function would have already returned with
the check if(!dock_state) right above.

Retrived from http://yo.dan.free.fr/wmaker.phtml.en

[crmafra: wrote the commit message]
2009-08-21 04:57:08 +02:00
Carlos R. Mafra
570df8316d Fix use of uninitialized variable
Gcc-4.3.2 warns:

texture.c: In function 'wTextureMakeFunction':
texture.c:393: warning: 'fallbackColor.pixel' is used uninitialized in this function

Based on a patch by Vladimir Nadvornik.
2009-08-21 02:20:27 +02:00
Vladimir Nadvornik
21b5df494b Less strict font requirements
Fixes bug:

  https://bugzilla.novell.com/show_bug.cgi?id=154758
2009-08-21 02:10:50 +02:00
Vladimir Nadvornik
e113ec10c9 Fix findBestIcon()
This patch fixes the issue described here:

https://bugzilla.novell.com/show_bug.cgi?id=371974
2009-08-21 01:54:26 +02:00
Daniel Déchelotte
95a576bd62 Fix "smart" placement bug when there are shaded windows in other workspaces
Bug overview:
    New windows are sometimes mis-placed when the "smart" algorithm is used.

How to reproduce it:
    be sure (with WPrefs.app, for instance) to use the so-called "smart"
    window placement algorithm. In an empty workspace, open a first window
    (for instance, an xterm). The window should appear at the upper left corner.
    Shade it (hide its contents below its title bar by double-clicking on it)
    and select another empty workspace. Open another window. Instead of placing
    it at the exact same place as the first window, wmaker places the new
    window a little bit lower, or frankly to the right.

Explanation and correction:
    when placing a new window, wmaker avoided all shaded windows, instead of
    only avoiding the shaded windows on the active workspace.
2009-08-20 23:59:41 +02:00
Daniel Déchelotte
3f7110b120 Fix focus issues with the switch panel and auto-focus
1. Setup two windows in a workspace, one at the center and the
   other at a corner. Move the mouse to the center of the screen, so
   that the focus goes to the center window. Now, with the help of the
   keyboard (with Alt-tab, typically), try and switch the focus to the
   other window. In doing so, the switch panel shows up, gives the
   focus to the other window and then disappears. However, its
   disappearance make it seem to wmaker that the mouse has just
   entered the center window, so wmaker gives the focus to that
   window again.

   2. It is a lit bit more involved. "Raise window when switching
   focus with keyboard" needs to be set. In a given workspace, maximize
   a first window A, then setup "above" window A two windows B and C
   (one in the upper left corner and the other one in the lower right
   corner, for example). Move the mouse so as to give the focus to
   window B. Press the Alt key, hit the key tab once (window A moves
   up to the "top"), then another time (window C is then selected).
   Eventually relase the Alt key: window B is given the focus again.

Correction: it is a matter of ignoring some (EnterNotify) events
when the switch panel is active or has just been used.
2009-08-20 22:07:10 +02:00
Carlos R. Mafra
f9bb2a428a Escape key handling in switchpanel
Pressing the escape key (ESC) while the switchpanel is active
cancels it and gives the focus back to the window which had it
before the switchpanel was invoked.

If all windows are minimized before the switchpanel was called,
they will continue to be if ESC is pressed.

In other words, pressing ESC is like going to the parallel universe
where you never entered the switchpanel in the first place.

Based on a patch by Nicolas Bonifas from 17.08.2009.
2009-08-20 16:00:26 +02:00
Carlos R. Mafra
333dbf5418 Use helper function in StartWindozeCycle()
This way we avoid code duplication in 6 places.

This changes the previous behavior of the first
instance because the helper function has an extra

       CommitStacking(scr);

 compared to the original code. But it should not
 hurt to have it.
2009-08-20 15:46:45 +02:00
Carlos R. Mafra
a9238c99b9 Clean up coding style in StartWindozeCycle()
No functional changes were made apart from
setting the various KeyCode variables at the
same time as defining them.
2009-08-20 15:09:07 +02:00
Carlos R. Mafra
4a041b6f0a Clean up StartWindozeCycle()
We can get rid of one overall tab by moving the

   if(swpanel)

test -- which was done everytime in each individual case --
to the beginning, therefore encompassing all cases.
2009-08-20 04:07:15 +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
Carlos R. Mafra
59fc927dc9 Make drawIconProc() static
It is used only inside src/dialog.c
2009-08-20 00:57:03 +02:00