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

214 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
c815449e68 Remove unused wWindowCanReceiveFocus()
The function wWindowCanReceiveFocus() is not used, remove it.
2012-06-25 23:53:32 +01:00
Rodolfo García Peñas (kix)
02feb72fdc New colormap header file and remove unused functions
The functions related to colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.

The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because they are not used.
2012-06-25 23:49:10 +01:00
Rodolfo García Peñas (kix)
da4e4128b3 rootmenu header file updated
The contents of the rootmenu.h file are not used and can be removed,
but the prototypes of rootmenu.c are in funcs.h and should be moved
to the correct (rootmenu.h) file.
2012-06-24 12:30:17 +01:00
Rodolfo García Peñas (kix)
6110610f5e Cleanup superfluous.c a bit
The superfluous.[ch] files have a few minor issues, this patch addresses some of them:

- Move the defines to the top of the superfluous.c file
- Include the ifdef NORMAL_ICON_KABOOM inside the DoKaboom() function
  because the DoKaboom is used without the NORMAL_ICON_KABOOM ifdef in
  other files.
- Include the ifdef WINDOW_BIRTH_ZOOM inside the DoWindowBirth() function,
  therefore the function don't needs to be defined twice (with and whitout
  WINDOW_BIRTH_ZOOM define.
- Now the functions are defined in superfluous.h and the externs are not
  needed.
  - We need include the dock.h in the superflous.h because is used by the
    definition of MakeGhostDock().
  - We need include the superfluous.h in window.c (removing the extern)
2012-06-23 11:25:37 +01:00
Tobias Stoeckmann
cc30444dda No need to call memset after wmalloc
memset is the last function call in wmalloc, just before it returns the
newly allocated memory.  Therefore it is not needed to call it again
after wmalloc call.  Although I would prefer to switch wmalloc to a
calloc-based wcalloc function, the compatibility of WINGs for old apps
should be kept.
2012-05-04 18:41:01 -03:00
Rodolfo García Peñas (kix)
761fd37e51 WindowMaker: Clean curly brackets
This patch removes the unneeded curly brackets in multiple files.

It also add some comments in the code. In usermenu.c removes some
variables not used.
2012-04-15 23:15:20 -03:00
Rodolfo García Peñas (kix)
4f4ea569a0 Coding style cleanups 2012-03-04 09:08:52 +00:00
Alexey I. Froloff
e819818eeb Options for limiting window/menu title height
(Window|Menu)Title(Min|Max)Height defaults options allow to set
minimum and maximum titlebar height.

For example, to force all titlebars to 24 pixels execute
following commands:

$ wdwrite WindowMaker WindowTitleMinHeight 24
$ wdwrite WindowMaker WindowTitleMaxHeight 24
$ wdwrite WindowMaker MenuTitleMinHeight 24
$ wdwrite WindowMaker MenuTitleMaxHeight 24

Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2012-02-27 14:19:49 +00:00
Tamas TEVESZ
dce16306bc Plug some (possible) memleaks
PropGetWMClass()

- XAllocClassHint()s a struct for class hint data
- This is filled by XGetClassHint(), which in turn uses Xlib to allocate
  some more space for XClassHint members
- Upon XGetClassHint() failure, "default" is libc malloc'd (via strdup),
  and is returned to the caller
- Upon XGetClassHint() success, XClassHint members are returned raw --
  these members must be freed with XFree() (see XAllocClassHint(3))
- Thus it's up to PropGetWMClass() callers to decide (based upon the return
  value) which method (libc free() or XFree()) to use to free res_name
  and res_class. This was done nowhere, thus leaking some memory
  on every failed PropGetWMClass() call.
- So just strdup the successful res_name/res_class members, XFree() them
  while still in PropGetWMClass(), and allow callers to unconditionally
  libc free() whatever PropGetWMClass() returns.
2011-04-18 13:25:44 -07:00
Brad Jorsch
125cba8f82 Paint app icons when updated
Add calls to wAppIconPaint when wIconUpdate is called on the app icon.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-08 22:03:31 +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
b16181143c Fix stuck appicon from embedded apps
When applications are embedded in firefox via mozplugger, e.g. ooffice
for viewing .doc files or xpdf for viewing pdfs, and the embedded
application opens a popup window, we end up with a shared appicon for
the embedded app that remains until Window Maker is restarted.

The underlying cause is that mozplugger winds up reparenting the
embedded app's original leader window to a subwindow of itself, so
wmaker's SubstructureNotifyMask on the root window no longer picks up
the DestroyNotify when that original leader is destroyed.

It seems easy to fix once you track down the problem: when fixing
several other properties in fixLeaderProperties(), add
StructureNotifyMask so we get DestroyNotify no matter where the leader
gets reparented to. A more targeted fix would only add
StructureNotifyMask when the fake group's origLeader is set, but I don't
think a few extra structure notifications are going to cause us any real
problems.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:31 +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
Brad Jorsch
b305eb84fb Ignore shared_appicon if an appicon already exists
An appicon is created for each group of windows, as specified by the
WM_HINTS window_group or the WM_CLIENT_LEADER. The "shared_appicon"
feature ignores the group leader specified by the application, replacing
it with a dummy leader matching the window's WM_CLASS. This causes
issues for dockapps, since each instance of a dockapp needs its own
appicon to display the different icon_windows, so shared_appicon is
automatically disabled for dockapp windows.

If the application creates some dockapp windows (no shared_appicon) and
some regular windows (with shared_appicon) with the same leader, it can
unexpectedly end up with two different appicons: one for the real group
leader it set and one for the fake leader created for shared_appicons.
Both of these appicons will try to use the same icon_window, which may
cause the dockapp window to suddenly lose its contents as they are moved
to the fake leader's appicon.

There is a simple fix: if a WApplication already exists (and has an
appicon) for the app-specified group leader window, disable
shared_appicon.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:30 +02:00
Tamas TEVESZ
94a0c7b42f Fix some double newlines
Just a couple that woud now print double (or several more) newlines.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Brad Jorsch
8f63bdafcd Periodic bouncing for XUrgencyHint
When a window has XUrgencyHint set, bounce the app icon periodically.
2010-09-17 11:05:51 +02:00
Brad Jorsch
9318a7f428 Improve dockapp recognition
On Wed, Sep 15, 2010 at 04:40:52PM +0200, Gilbert wrote:
>
> "." = {NoAppIcon = Yes;};
>   "*" = {NoAppIcon = Yes;};

Oh, I see. It lets you override NoAppIcon generically instead of for
each app.

> Exactly, having 'DockApp' as the class name makes them behave more
> consistently internally. This might be fixed in some other way
> internally, but I couldn't figure it out...

Except it doesn't, the only thing it changes inside wmaker is that it
avoids displaying the name as "DockApp" on the settings window.

A "dockapp" is just an application that sets icon_window in WM_HINTS
(which causes a window to be displayed as the app icon) and
initial_state to WithdrawnState (which causes the main window to not
actually appear when the window is mapped). The class has nothing to do
with it.

The problems I mentioned stem from gtk+ not allowing you to set
initial_state to WithdrawnState. Openbox and fluxbox (and maybe others)
don't take the icon_window into their "slit" unless initial_state is
WithdrawnState, so the whole thing completely fails. Wmaker always uses
the icon_window for the app icon, so that part works fine, but the
"main" app window still flashes onscreen for a split second before the
app can call gdk_window_withdraw(), and wmaker applies SharedAppIcon to
it which winds up screwing up the "Kill" menu option.

That said, I've attached a patch to have wmaker treat any window with
class DockApp as if it had initial_state = WithdrawnState, and hopefully
openbox, fluxbox, and the like will pick up the idea too so gtk+
hacks[1] will no longer be needed. If this patch is accpeted, I'll poke
fluxbox and openbox to suggest the idea to them.

[1] E.g. http://wmudmount.svn.sourceforge.net/viewvc/wmudmount/dock.c?r1=8&r2=7

Subject: [PATCH] Improve dockapp recognition

Dockapps are traditionally recognized by having initial_state =
WithdrawnState in WM_HINTS. But some toolkits (e.g. gtk+) will not allow
setting initial_state in this way. So we offer an alternative: any
window with the res_class portion of WM_CLASS set as "DockApp" will be
treated as if it had initial_state = WithdrawnState.
2010-09-15 20:36:46 +02:00
Alexey I. Froloff
a257e16593 Bouncing appicon effect
When starting application (or opening transient dialog) bounce
its appicon.

Original-patch-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-11 17:53:32 +02:00
Brad Jorsch
68bd644b0d Fix wheel resizing with resize increments
In C, dividing two integers automatically rounds towards zero, so ceil(a
/ b) is useless as the result is truncated before ceil ever sees it. The
correct result for positive integers is obtained by (a + b - 1) / b.
2010-04-26 23:23:56 +02:00
Brad Jorsch
4ddc2a5a0a Don't grab Ctrl+Wheel if ResizeIncrement is 0
I personally cannot stand stealing Ctrl+Wheel for resizing windows, so I
turned it off. But wmaker is still preventing Ctrl+Wheel from reaching
apps, which is certainly not the behavior I desire.
2010-04-26 23:23:56 +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
Brad Jorsch
37829a7c60 Fix loading saved states on 64-bit systems
One misuse of CARD32 was missed back when someone fixed the 64-bit
issues (background: X has 8-bit, 16-bit, and "32-bit stored in a long"
data formats; on a 64-bit system, long is 64 bits). This was causing
minimized windows to be restored as shaded, and possibly occasional
crashes, when wmaker was restarted.

Also, throw in a safety check that 10 items really were returned before
trying to access them.
2010-04-12 09:58:37 +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
Carlos R. Mafra
0c2d2c69b9 Use 'long' instead of 'CARD32' in wClientSetState() and wWindowSaveState()
The rationale is the same as in commit c7f2a189c4
("Fix the call to XChangeProperty() in 64-bit mode"), because we are
calling XChangeProperty() with format 32, which requires the type of
'data' to be 'long'.
2010-03-29 00:17:02 +02:00
Carlos R. Mafra
13ba5d5f5b Remove uncompiled code from src/window.c 2010-03-29 00:17:02 +02: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
0db4d7885b Make CTRL+Wheel less intrusive
This patch only calls XGrabButton for CTRL+Button4 and CTRL+Button5.
This leaves CTRL+Button1-3 to the application.

This then removes the functionality of moving a window between
workspaces with CTRL+Button1 and CTRL+Button3
2010-03-14 22:19:08 +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
Ralf Hoffmann
d74a90d1bf changed behavior when focusing new windows with autofocus enabled
New windows will only get focused if the mouse is on the same screen.
The code doesn't handle multiple heads but since it's just one screen
the function works as usual. Checking the head and assign the focus only
if the window is on the same head might be a good idea. Making the whole
stuff optional might be even better.
2009-12-08 16:14:29 +01:00
Ralf Hoffmann
6c6e832c52 activate XGrabServer again
This patch fixes a small problem which only rarely occurs. If a
window is opened only for a very short time and closed right away, in
some circumstances the frame around it stays opened. It looks like
Window Maker doesn't get the destroy message. The XGrabServer call was
commented in the code so I activated it again which seems to prevent this
from happening. I think it actually make sense since the ungrab calls are
used anyway in the following code.
2009-12-08 16:14:29 +01:00
Carlos R. Mafra
347fbcc87a Remove unused function wWindowCheckAttributeSanity()
As pointed out by Nicolas Bonifas, wWindowCheckAttributeSanity() is
currently unused. Removing it saves 200 bytes:

  text    data     bss     dec     hex filename
  23476       0       8   23484    5bbc src/window.o.new
  23676       0       8   23684    5c84 src/window.o.old
2009-12-06 15:35:25 +01:00
Nicolas Bonifas
2203b229b0 Fix the empty button in titlebar after going fullscreen bug (Debian bug #298873) 2009-11-17 01:42:15 +01:00
Johann Haarhoff
1f1eb393f8 Mod+Wheel resize increment now respects size hints
Thanks to Iains patch which showed me how to access the window hints, I
now propose the following: The resize increment is set to the closest
multiple of the size hints larger than wPreferences.resize_increment.

This should fix Carlos' complaint about fixed-increment windows resizing
too "slowly", and it also fixes my complaint about the blank space below
the last line of an xterm.

Thanks to:
    Iain Patterson <wm@iain.cx>
2009-10-13 12:17:57 +02:00
Iain Patterson
bf88570a5f Respect size hints when resizing with wheel.
Use height and width increment when wheel resizing if size hints are
set on a window and meaningful height and width increments are
specified.
Windows which don't care about their resize increments will have height
and width increments set to 1.  For these windows - and windows without
resize hints at all - use the setting configured with ResizeIncrement.
2009-10-12 15:24:13 +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
347e804bb6 A few trivial code style cleanups 2009-10-11 23:30:41 +02:00
Johann Haarhoff
a063338175 Mod+Wheel Window Resize
This patch adds the ability to resize windows with the mouse wheel
while holding the Mod key. This currently ignores wWindowConstrainSize
until I can figure out a way to repeatably resize windows with
fixed size increments (like xterm) using this method.

This also adds a slider to WPrefs to choose the increment with which
the wheel will resize a window.
2009-10-11 22:17:54 +02:00
Carlos R. Mafra
513a509096 Fix the use of uinptr_t
Remove the additional cast to (int), as that makes no sense.
2009-09-14 16:51:26 +02:00
Carlos R. Mafra
cbd13dd95f Ansify function declaration 2009-09-13 16:07:54 +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
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
06f59b9928 wmaker: Fix compiler warnings about pointer <--> integer conversion
There may be issues with running applications in 64-bit mode when
they were written with tacit assumptions about 32-bit platforms.
For example,

    * Assuming that a pointer can be cast back and forth to an integer

The reason is that the size of the integer and pointer may be different.
See the description of "[PATCH] Warn when casting a pointer (constant)
to an integer of different size." in the gcc mailing list

http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html

where it was also suggested the use of casts to uintptr_t. This is
what this patch does.

As a result the following warnings are fixed, leaving us with an
almost warning-free compilation in 64-bit platforms:

defaults.c:1446: warning: cast to pointer from integer of different size
defaults.c:1457: warning: cast to pointer from integer of different size
defaults.c:1471: warning: cast to pointer from integer of different size
defaults.c:1486: warning: cast to pointer from integer of different size
icon.c:67: warning: cast from pointer to integer of different size
menu.c:112: warning: cast from pointer to integer of different size
switchmenu.c:452: warning: cast from pointer to integer of different size
window.c:140: warning: cast from pointer to integer of different size
window.c:2217: warning: cast to pointer from integer of different size
workspace.c:135: warning: cast to pointer from integer of different size
workspace.c:214: warning: cast to pointer from integer of different size
workspace.c:634: warning: cast to pointer from integer of different size
workspace.c:1330: warning: cast to pointer from integer of different size
workspace.c:1514: warning: cast to pointer from integer of different size
wfilepanel.c:135: warning: cast from pointer to integer of different size
wfilepanel.c:171: warning: cast from pointer to integer of different size
wfontpanel.c:499: warning: cast to pointer from integer of different size
wfontpanel.c:500: warning: cast to pointer from integer of different size
wfontpanel.c:505: warning: cast to pointer from integer of different size
wfontpanel.c:506: warning: cast to pointer from integer of different size
wfontpanel.c:776: warning: cast from pointer to integer of different size
wfontpanel.c:777: warning: cast from pointer to integer of different size
wfontpanel.c:877: warning: cast from pointer to integer of different size
wfontpanel.c:878: warning: cast from pointer to integer of different size
wpanel.c:363: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:90: warning: cast to pointer from integer of different size
puzzle.c:138: warning: cast from pointer to integer of different size
puzzle.c:225: warning: cast to pointer from integer of different size
wtableview.c:1031: warning: cast to pointer from integer of different size
wtableview.c:1067: warning: cast to pointer from integer of different size
wtableview.c:1069: warning: cast to pointer from integer of different size
wtableview.c:1074: warning: cast to pointer from integer of different size
wtabledelegates.c:234: warning: cast from pointer to integer of different size
wtabledelegates.c:250: warning: cast from pointer to integer of different size
wtabledelegates.c:265: warning: cast from pointer to integer of different size
wtabledelegates.c:287: warning: cast to pointer from integer of different size
wtabledelegates.c:351: warning: cast from pointer to integer of different size
wtabledelegates.c:372: warning: cast from pointer to integer of different size
wtabledelegates.c:393: warning: cast from pointer to integer of different size
wtabledelegates.c:410: warning: cast to pointer from integer of different size
test.c:44: warning: cast from pointer to integer of different size
test.c:47: warning: cast to pointer from integer of different size
test.c:55: warning: cast from pointer to integer of different size
test.c:58: warning: cast from pointer to integer of different size
2008-11-06 09:07:50 +01:00
dan
c0317ddae5 eliminated gcc-4 compilation warnings 2005-08-22 23:58:19 +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
880880162b Fixed bug that caused wmaker to crash when kplayer was switched back from
fullscreen mode to windowed mode.
2005-03-22 23:15:11 +00:00
dan
193a63511d - Fixed all // comments
- Final cleanups
2004-10-23 03:30:03 +00:00
dan
d08691d5a5 - Changed fallback font to 'sans serif:pixelsize=12'
- Fixed convertfonts to account for $LANG
- Fixed convertfonts logic a bit and no longer output slant and weight if
  they are the default ones (medium and roman)
- Applied Pascal's fix for GNUstep menus (modified to also include submenus)
  Still this is not the proper fix, as it can't differentiate between
  submenus and other windows at the floating window level. Correct fix needs
  some extra hints to be set by GNUstep on menus.
2004-10-22 22:27:11 +00:00
kojima
7055530895 - Added support for NET_WM_NAME/NET_WM_ICON_NAME
- moved out font name conversion code from getstyle/setstyle/convertfonts and made it support fontsets
2004-10-16 22:05:04 +00:00