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

187 Commits

Author SHA1 Message Date
Carlos R. Mafra
c33455fdb4 Inotify: Use wwarning() instead of fprintf() 2012-01-22 10:20:31 +00:00
Tamas TEVESZ
f65b99e615 Remove warnings
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
  to be tweaked on a per-implementation basis as problems arise)
2011-03-24 16:19:52 +01:00
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
Carlos R. Mafra
80814b7dba XRandR temporary amendments
If we Restart() directly, the windows with titlebars come back N pixels
below their original positions before the xrandr-induced restart, where
N is the titlebar height.

To avoid this issue, let's do the proper restart preparation before
actually calling Restart().

Let's also grab ConfigureNotify in the event loop as in the patch
here: http://lists.kde.org/?l=kwin&m=116429907520188&w=2
(thanks to Tamas for pointing it out).

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2010-10-07 12:04:28 +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
Carlos R. Mafra
c201e1612c Make wmaker XRandR aware
This patch makes wmaker automatically Restart() to take into account
resolution changes done by xrandr.

The motivation to write this patch is that when I start my laptop connected
to an external monitor (VGA1), the resolution in the monitor is initially
wrong (perhaps this is a bug in XOrg or OpenSuse, but anyway), so I always
do this after starting wmaker:

xrandr --output VGA1 --preferred

The resolution in the external monitor gets fixed, but wmaker does not
recognize the change automatically and I have to manually restart it.

So this patch avoids the last step by making wmaker be XRandR-aware.
Wmaker now restarts automatically when it receives a RRChangeScreenNotify
event and I don't have to do the last part of the silly procedure described
above.

I am not sure if restarting wmaker is the most elegant solution, but
it at least solves part of my issue with wmaker + xrandr.
2010-08-22 22:13:45 +02:00
Brad Jorsch
12d16d92e7 Fix mouse button grab swallowing
We grab Mod+Button events for our own purposes, and swallow them using
XAllowEvents(AsyncPointer) to prevent the client window from seeing
them. But if events are coming in fast enough (e.g. via fast wheel
scrolling) so that multiple grabbed events are in the queue, the second
queued event would be allowed to leak through to the client by the
unconditional XAllowEvents(ReplayPointer) a few lines later.
2010-04-26 23:23:56 +02:00
Brad Jorsch
65aa3ae9c8 Fix enable-modelock warnings
Fix warnings that only show up when --enable-modelock is passed to
./configure.
2010-04-12 09:58:36 +02:00
Brad Jorsch
bbf3635590 XShapeEvent strict aliasing violation
C99 defines new strict aliasing rules to allow compilers to make certain
optimizations. These rules prohibit converting an XEvent to an event
struct (e.g. XShapeEvent) that is not already in the XEvent union using
pointer type punning (e.g. "(XShapeEvent *)&ev"), and vice versa. The
canonical fix seems to be to create a union between XEvent and the
extension event struct to make the aliasing explicit, so do that.
2010-04-12 09:58:36 +02:00
Tamas TEVESZ
81aaed2bf8 Tidy comms between external apps and wm a bit
- one instance of this left in setstyle, it will follow later
2010-04-02 08:41:11 +02:00
Tamas TEVESZ
c7868fa405 Make inotify optional
This time keeping the ability to fall back to the old polling method.
2010-03-23 21:50:17 +01:00
Carlos R. Mafra
5178465bb6 Remove DEBUG statements, #if 0 etc
...and some other cleanups.
2010-03-20 18:42:56 +01:00
Carlos R. Mafra
8018da8149 Constify WMMatchDataProc and fix fallout
It addresses this warning

dialog.c: In function ‘LoadHistory’:
dialog.c:209: warning: passing argument 2 of ‘WMFindInArray’ from incompatible pointer type
../WINGs/WINGs/WUtil.h:455: note: expected ‘int (*)(void *, void *)’ but argument is of type ‘int (*)(const void *, const void *)’

but induces others in other places. One of them was this one

window.c: In function ‘wManageWindow’:
window.c:782: warning: passing argument 2 of ‘WMFindInArray’ from incompatible pointer type
../WINGs/WINGs/WUtil.h:455: note: expected ‘int (*)(const void *, const void *)’ but argument is of type ‘int (*)(void *, void *)’

which is fixed by constifying the arguments of matchIdentifier(). The other warnings are
fixed similarly.
2010-03-17 13:34:24 +01:00
Johann Haarhoff
744ccb85d2 CTRL+Wheel Horizontal Resize + extras
This patch constrains MOD+Wheel to vertical resize, and adds
CTRL+Wheel horizontal resize. Two resize in both directions, you
have to use CTRL+MOD+Wheel.

To enable this functionality I have to grab all CTRL+Mousebutton
events in wmaker, which stops them from reaching the application.
This definitely hurts application functionality in some apps, for
example the "VT Fonts" (CTRL+Button3) menu in xterm is no longer
accessible. To stop this from happening use the "Do not bind mouse
clicks" window attribute for the apps in which you want to disable
this.

Because wmaker now controls all CTRL+Mousebutton events, I also
added CTRL+Button1 and CTRL+Button3 shortcuts that will move a
window back and forth through your workspaces without changing its
position or size.
2010-03-14 22:10:24 +01:00
Carlos R. Mafra
72dfe4aa89 Remove VIRTUAL_DESKTOP code
Even the option to enable "virtual desktop" in configure.ac was
commented out...and I would never intend to use it anyway.

So let's just remove the ~800 lines of #ifdef'ed code to have a
cleaner code base to read when bored.
2010-01-09 13:48:06 +01:00
Carlos R. Mafra
643e49f190 Remove [raise,lower]clip shortcut keys
The raising and lowering of the clip is already taken care of
by the "ClipRaiseLowerKey" shortcut.

wmaker gets a bit smaller for free:
   text    data     bss     dec     hex filename
 449483   17384    8208  475075   73fc3 src/.libs/wmaker.old
 449307   17256    8192  474755   73e83 src/.libs/wmaker.new
2010-01-09 13:47:57 +01:00
Brad Jorsch
b6689a0108 Keyboard shortcut to raise the dock
This patch adds the DockRaiseLowerKey shortcut, which raises/lowers
the dock depending on whether the dock is lowered/raised.

[crmafra: Reformatted Brad's patch against git repo and removed the
 DockRaiseKey and DockLowerKey shortcuts ]
2010-01-07 12:16:17 +01: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
Iain Patterson
18408fff93 Mac OS X-style window cycling.
For those not familiar with the way Macs cycle windows, the Command-Tab
sequence (Alt-Tab elsewhere) switches between DIFFERENT application windows
and Command-Grave (key above tab) switches between windows owned by the
SAME application as is currently focused.  So if you had three Safari and
two Finder windows open, and Safari had focus, Command-Tab would switch to
Finder; Command-Tab would switch back to Safari; Command-Grave would switch
to a different Safari window etc.

This patch implements "something like" the above by only populating the
switchpanel with windows matching the currently-focused WWindow's wm_class
when the new cycling mode is activated.  In practice this means you can
switch to The Next XTerm or The Next Firefox Window using this method.

The configuration names for these new shortcuts are GroupNext and
GroupPrev.  The patch tells WPrefs.app about them.  Of course switching to
The Next Window is still possible with the (unchanged) FocusNext and
FocusPrev keys.
2009-09-14 16:51:26 +02:00
Carlos R. Mafra
4bce3e3805 Make left/right maximization work again
The patch "Clean up maximization and un-maximization logic" introduced
a regression wrt to the left/half maximization feature, due to a C
operator order precedence issue.
2009-09-13 18:32:43 +02:00
Carlos R. Mafra
8efc490361 Reduce the number of simultaneous inotify events
There is no point in having a buffer capable of 512 simultaneous events,
as it will typically be only 1. But increase the value for the length
of the path + filename to 64 (which is a reasonable size for a
typical /home/something/GNUstep/Defaults/WMRootmenu filename).
2009-09-04 15:02:00 +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
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
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
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
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
066af13b5c Clean up case switching in handleKeyPress()
GCC has an extension to deal with ranges within case statements.
Let's use it to make the code more readable and ~5% smaller,

[mafra@Pilar:wmaker.git]$ size src/event.o.*
   text    data     bss     dec     hex filename
  13087       0    1056   14143    373f src/event.o.new
  13711       0    1056   14767    39af src/event.o.old
2009-08-19 22:11:15 +02:00
Carlos R. Mafra
cb31fd374c Sanitize calling sites of wDefaultsCheckDomains()
There is no point in having parameter in wDefaultsCheckDomains() and
not using it, so let's simply remove the parameter altogether and
avoid silly-looking things like

    wDefaultsCheckDomains("bla");
2009-08-18 16:20:18 +02:00
Carlos R. Mafra
9baff1363c handleKeyPress: Fix shadowing of global 'index' variable
GCC warns:

event.c: In function 'handleDestroyNotify':
event.c:676: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:309: warning: shadowed declaration is here
event.c: In function 'handleKeyPress':
event.c:1435: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:309: warning: shadowed declaration is here

So let's rename "index" to "widx".

Note that there is a more serious shadowing in this same function,

event.c:1686: warning: declaration of 'wwin' shadows a previous local

but this is more complicated to solve.
2009-08-18 00:56:09 +02:00
Carlos R. Mafra
f18567db9a inotifyHandleEvents: Reduce buffer size to avoid huge memory consumption
inotifyHandleEvents() was allocating a buffer of size

 (sizeof(struct inotify_event) + FILENAME_MAX)*1024

where FILENAME_MAX is #defined to be 4096 in stdio_lim.h, therefore
it was more than 4 MB!

Reduce it by using 16 instead of FILENAME_MAX and 512 instead of 1024.

Now valgrind does not complain about things like

Invalid write of size 8
 at 0x42002F: inotifyHandleEvents (event.c:323)
 by 0x7FF00020F: ???
 Address 0x7febfc148 is on thread 1's stack

I also made some small coding style changes.
2009-08-18 00:39:45 +02:00
Carlos R. Mafra
6b08fc9e78 Trivial cleanup 2009-08-08 23:38:26 +02:00
Rodney Padgett
56d8568787 Use inotify to check for changes to the defaults database. Workaround for
event handler timer.

After upgrading my kernel recently I noticed that dnotify has been
depreciated, so I decided to try and implement the new inotify code in
Window Maker instead.

During testing, I also found that one of the timers which was removed
(the one causing the most wake-ups), calling delayedAction, was
responsible for handling signals. Basically with this timer removed,
signals were only handled after an X event occurs.

After looking at the delayedAction function, I couldn't see the purpose of it.
It certainly wouldn't cause any delay as it was called by the timer every
500ms, so there is no time correlation with when a signal was received.
Also, it appeared to count the signals and call DispatchEvent for each
one, but it appears DispatchEvent would just handle the most recent signal
and take action on that. The signals handled by delayedAction are the
various exit and reset signals, so only one need to be handled. I
therefore have commented out delayedAction (it wasn't called by any other
procedure) and added a call to DispatchEvent imediately after the signal
is registered, in handleExitSig.

I'm not sure what problems this may cause with dead children - these are
only cleaned up after an Xevent now that the timer is removed- but I
haven't observed any problems since a few months ago.
2008-08-09 13:14:39 -05:00
Carlos R. Mafra
722c82c8ab wmaker: Reduce wakeups to zero
This patch removes wmaker from PowerTop's shame list, where
it appeared with ~3-4 wakeups/second.

It adds the linux kernel's dnotify mechanism (adapted from
the example in Documentation/dnotify.txt in the kernel source),
to detect when a configuration file in ~/GNUStep/Defaults has
changed to load it again on-the-fly. For me it usually means that
modifications to ~/GNUStep/Defaults/WMRootMenu via the 'genmenu'
script are automatically detected and loaded.

The use of dnotify makes the ancient behaviour of polling unecessary
and cuts down the wakeups count.

Other 'apparently' useless timers are also deleted and it's been almost
one year now that I use this patched exclusively without problems, so
I am pretty sure that it doesn't hurt to remove them.

The end result of all this is that wmaker generates 0 (zero) wakeups
when idle in a Linux system.

Signed-off-by: Carlos R. Mafra <crmafra@ift.unesp.br>
2008-05-02 20:01:50 -03:00
dan
c0317ddae5 eliminated gcc-4 compilation warnings 2005-08-22 23:58:19 +00:00
dan
897e75d554 - Fix that enables that the virtual desktop code be disabled on the fly
when VirtualEdgeThickness is set to 0
- Fixed virtual edge to resize the edge on the fly if thickness changes
2004-10-24 20:24:23 +00:00
kojima
620a280d64 code review 2004-10-22 23:39:11 +00:00
kojima
30247c5886 dont bring up root menu when fullscreen window is focused 2004-10-18 01:43:13 +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
kojima
879b00a57b - Removed legacy OFFIX_DND support code
- Fixed the signal handler for crashes (ie, removed it) and made wmaker
  restarting be made automatically by a monitoring process.
- Made NetWM support be enabled by default
- Removed old code to store/restore workspace state (now relies on netwm)
2004-10-13 05:09:08 +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
474c4caf94 reverted the last test commit (duh) 2004-07-16 18:50:58 +00:00
dan
109bb540ec another test for cvs notifications 2004-07-16 18:18:36 +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