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

181 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
a950d0e247 Update icon images before calling wIconUpdate
This patch updates the icon images if needed before calling wIconUpdate.
2012-11-11 11:59:19 +00:00
Rodolfo García Peñas (kix)
33ebded4f9 wAppIconPaint paint argument
The function wAppIconPaint has a new argument. This argument is used
to force an icon create if needed.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
a3078a5095 wDockAttachIcon paint argument
The function wDockAttachIcon has a new argument. This argument is used
to force an icon create if needed.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
6bc48464e9 wDockAttachIcon icon_editing is common in if else
The line "icon_editing = 0" is the first line in the "if" sentence
and the first (and only) sentence in the "else" block, so can be
moved outside the if-else (and the empty else block can be removed).
2012-11-10 19:41:34 +00:00
Rodolfo García Peñas (kix)
e988386013 Removed block in restore_icon_state
The block inside restore_icon_state is not needed, so can be removed.

There are no changes with or without the block (variables scope,...).
2012-10-06 15:29:58 +01:00
Rodolfo García Peñas (kix)
a089647d27 Coding style cleanup in dock.c
This patch reviews the code style in dock.c, removing some
curly brackets not needed and adding other where needed.

This patch removes some lines commented and some extra lines for
better understanding.
2012-10-06 15:25:10 +01:00
Rodolfo García Peñas (kix)
f5d845cfad Remove unused argument from wDefaultFillAttributes()
The function wDefaultFillAttributes() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:45:56 +02:00
Rodolfo García Peñas (kix)
42cb1291e3 New move_window function 2012-06-25 23:43:39 +01:00
Rodolfo García Peñas (kix)
6bdc1318c1 Moving header functions to main.h
The functions of main.c should be included in main.h, not in funcs.h.
This patch adds the main.h file and moves the function prototypes to
this file.

The not needed "include funcs.h" are removed.
2012-06-24 12:32:36 +01:00
Carlos R. Mafra
b6ced4fa5d Address unprototyped call in dock.c
Create a header file dockedapp.h to address a long-standing warning
which pollutes the compilation output with --enable-silent-rules:

Making all in src
  CC     dock.o
dock.c: In function ‘wDockDetach’:
dock.c:2118:3: warning: call to function ‘DestroyDockAppSettingsPanel’ without a real prototype [-Wunprototyped-calls]
dock.c:65:13: note: ‘DestroyDockAppSettingsPanel’ was declared here
  CCLD   wmaker
2012-06-23 12:09:41 +01:00
Carlos R. Mafra
a1e80f5411 Unify save_appicon() and wAppIconSave()
Having two similarly named functions for doing the same thing is confusing.
In order to account for the extra check done by the late wAppIconSave(),
add an argument "dock".

Now there's only save_appicon().

And as pointed out by Rodolfo kix García, the save_appicon_core() function
can be removed too.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2012-06-21 20:34:22 +01:00
Tobias Stoeckmann
971f611bad wstrdup cannot fail, therefore no need to check for NULL. 2012-05-07 20:40:14 -03:00
Tobias Stoeckmann
70d8ad515b Easier error path in wDockTrackWindowLaunch.
There is no need to allocate command if the very next line might
fail independently from comand, freeing that memory again in error path.
2012-05-07 20:37:48 -03: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
Tobias Stoeckmann
975d4becf1 Fixed some typos. 2012-05-04 18:39:21 -03:00
Rodolfo García Peñas (kix)
afe2e5d9d6 WindowMaker: appicon.h clean code
Changes to appicon.h:

- Spaces replaced by tabs in the struct
- Removed unused variables:
  - client_machine, never assigned
  - gnustep_app, never used
- Functions sort by return type

Then, in dock.c, the block with client_machine is never true,
then can be removed. The host variable then is never used.
2012-04-15 23:15:20 -03:00
Carlos R. Mafra
799134f59b Remove wShowGNUstepPanel() etc
The only place where this function is called is from a double click
in the first icon of the dock, and only if there's no program already
associated with it.

This is a bit superfluous and most people have defined the first
icon to call WPrefs instead and end up never seeing that panel.
And since the last commit ("Change behaviour of the GNUstep dockapp"),
this is now also the default behaviour of Window Maker.

Furthermore, the panel itself is not accurate. Window Maker is not part
of the GNUstep project.
2012-02-19 10:05:31 +00:00
Carlos R. Mafra
51a54ba2e2 dock: Make some functions static 2012-02-12 21:35:09 +00:00
Carlos R. Mafra
4954d4df23 clip: Do not display balloon with workspace name
When the mouse passes over the clip, wmaker would display a "odd" balloon
text with the workspace name, but the balloon itself was covered by the
clip icon!

So if the workspace name was short enough ("Internet" is, by my testing here)
the user wouldn't see anything, the balloon is completely under the clip icon.

I found this issue because one of my workspaces is called "Beyonder" and I
noticed a small "r" under the clip one day.

Instead of trying to fix this, I just removed the whole thing about displaying
the balloon because it is superfluous and I haven't seen any bug reports about
this yet, so it probably means most people are not even aware of it.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2012-02-12 20:04:13 +00:00
Carlos R. Mafra
558fc5f0d3 dock: Trivial code style cleanups
Just random things I noticed while reading the code...

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2012-02-12 20:04:13 +00:00
Carlos R. Mafra
393a917a4f Remove dead code ifdef'ed by GRADIENT_CLIP_ARROW
GRADIENT_CLIP_ARROW was never defined anywhere and having fancier clip
arrows is not something particularly interesting, so let's simply remove
the code.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2012-02-11 19:08:28 +00:00
David Couzelis
0f26c43371 Prevent removal of dock icons due to resolution changes
I use xrandr to decrease the resolution of my display when I connect
it to my TV. When I change the resolution back to my monitor, a few
of the icons at the bottom of my dock are deleted.

This happens because wmaker computes the maximum number of dockapps
which the dock can hold based on the screen resolution:

        icon_count = scr->scr_height / wPreferences.icon_size;

and drops the dockapps above that number (in wDockRestoreState()).

But now the resolution can change via xrandr, so the above computation
can lead to dockapps being dropped when the new resolution is smaller
than it used to be.

To fix this it's enough to have a resolution-invariant number of allowed
dockapps.
2012-01-13 09:54:14 +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
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
a396f3bd66 Only cache pixmaps for docked icons
There is little point caching a pixmap for an app that isn't in the
dock. This patch creates a function wAppIconSave that saves only if the
app icon is docked, and adds calls to that function in all the places
where an appicon can transition from undocked to docked.

It also "adds" a function wApplicationSaveIconPathFor that saves an icon
path to the configuration plist; the function already existed, it was
just static before.

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
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
Alexey I. Froloff
790917a8e7 Option to disable clip title
Completely disable clip caption.

Original-patch-by: Alexey Voinov <voins@altlinux.ru>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-12 15:21:05 +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
6082f2d243 Fix trivial warnings
* Format string integer size warnings
 * Missing or non-value returns in non-void functions
 * A missing #include in WPrefs.app/MouseSettings.c
2010-04-09 15:16:31 +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
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
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
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
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
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
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
Tobias Stoeckmann
f516213bf3 Check for argc==0 when calling wtokensplit()
The WINGs-function wtokensplit does not set argv to NULL if no string has been
split - instead argc is set to 0.

You can only observe this issue if you compile Window Maker without any
optimization:

compile Window Maker with CFLAGS=""
run Window Maker and save a session
change session-file and replace a 'command xyz' line with 'command " "'
restart Window Maker
watch "Fatal error"-message

Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/
Submitted-by: Gilbert Ashley <amigo@ibiblio.org>
2009-08-16 00:16:58 +02:00
dan
193a63511d - Fixed all // comments
- Final cleanups
2004-10-23 03:30:03 +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
44f636e91e doc update; don't use clip's inactive collors for arrows when collapsed 2003-08-02 21:36:45 +00:00
dan
8457611316 fixes to comply to ANSI C 2003-07-16 20:58:49 +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
dan
e727cbadb6 - Fixed Clip's workspace menu mapping to be consistent with the others
- Fixed bug in wmsetbg that caused scale and maxscale to both do maxscale
  (Alexey Voinov <voins@voins.program.ru>)
2003-02-28 12:42:16 +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