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

63 Commits

Author SHA1 Message Date
Christophe CURIS
5a16cb8e02 Removed unused WScreen argument in some Default handling functions 2013-10-12 15:18:06 +01:00
Rodolfo García Peñas (kix)
9c6e71ead0 Removed unused WScreen argument
The argument WScreen was not longer used, so can be removed.
2013-10-12 15:16:03 +01:00
Christophe CURIS
d9832e578f wmaker: Moved global domain definition to the global namespace
The default domains were originally defined in different global
variables in C files; This patches groups them in a single
structure placed in global namespace.
2013-10-11 21:58:14 +01:00
Rodolfo García Peñas (kix)
278bf5ee7e get_icon_filename doesn't use WScreen
The function get_icon_filename now doesn't need the
argument WScreen, so can be removed.
2013-09-05 22:44:36 +01:00
Rodolfo García Peñas (kix)
453a0226ad wApplicationExtractDirPackIcon doesn't use WScreen
The function wApplicationExtractDirPackIcon now doesn't need the
argument WScreen, so can be removed.
2013-09-05 22:44:36 +01:00
Christophe CURIS
74cd836e48 wmaker: Replaced local 'extern' definition of wPreferences by proper header usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-30 15:10:09 +01:00
Christophe CURIS
c9b816de75 wmaker: Added 'const' attribute to remaining functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
9b5db31d95 wmaker: Added 'const' attribute to most global functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
f0c1dc9fc3 wmaker: Added 'const' attribute to most local functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Rodolfo García Peñas (kix)
41da1b30db New file misc.h
This is the new file misc.h, with the function prototypes for misc.c.
This file is created using misc.c and removing the prototypes from funcs.h
2013-04-17 10:13:25 +01:00
Daniel Déchelotte
95a73e2783 Added wDefaultPurgeInfo to remove what we stored about a given instance-class couple.
This function is not used for now, but will be for drawers
2013-04-12 02:14:10 +01:00
Rodolfo García Peñas (kix)
d8b92c979e get_default_image resize image
The function get_default_image, used to read the default image, now
resizes it to the desired size.
2012-11-14 22:49:42 +00:00
Rodolfo García Peñas (kix)
f38e5e40c8 get_default_image_path unused argument
The function get_default_image_path has the WScreen argument that
is not used, so can be removed.

The function could be static, but perhaps is interesting leave it
as public.
2012-11-10 19:49:13 +00:00
Rodolfo García Peñas (kix)
658597b889 wDefaultGetImage renamed to get_icon_image
The function wDefaultGetImage is renamed to get_icon_image.
2012-11-10 19:47:40 +00:00
Rodolfo García Peñas (kix)
c3a1c76b44 get_default_icon_filename rewritten
The function get_default_icon_filename(), now get_icon_filename(),
was working in a bad way. Before this patch, the function always
searched the default icon in the second search:

-     file_name = wDefaultGetIconFile(winstance, wclass, True);
+     file_name = wDefaultGetIconFile(winstance, wclass, False);

For this reason, the argument default_icon didn't work.

This patch change it. Now, if the default_icon is false, the function
can return NULL, then other functions can do the correct work. For
example, now wDefaultGetImage() doesn't need do nothing, because the
default_icon is set to True. get_icon_filename() checks if the
icon exists in the disk before returning it (except for default icon
in get_default_image_path(scr).
2012-11-10 19:42:24 +00:00
Rodolfo García Peñas (kix)
529276a395 Solved bug if icon doesn't exists
There is a bug in wmaker with icon files set in config files, but
that doesn't exist in the disk. For example, if the config files have:

etc/WindowMaker/WMWindowAttributes:
  xcalc = {AlwaysUserIcon = Yes;Icon = "HP-16C-48.xpm";};
share/WindowMaker/IconSets/Default.iconset:
  xcalc = {AlwaysUserIcon = Yes;Icon = "HP-16C-48.xpm";};

But the icon "HP-16C-48.xpm" doesn't exist in the disk, wmaker does:

1. Load the config file in memory, in a database
2. When the application is launched, wmaker tries to find their icon in
   the database (using wDefaultGetIconFile), the icon is found: HP-16C-48.xpm
3. When WindowMaker try to find the full path for the icon, using FindImage(),
   WindowMaker cannot find the icon, and returns NULL.
   Even, if the user set the default_icon boolean variable to True, wmaker
   finds in the database the wrong icon.

This patch checks that the icon exists both in the database AND in the disk. If the
icon doesn't exist in the disk and the default_icon variable is set to True,
then windowmaker loads the default icon using the function get_default_image()
because this function searches the default icon directly.

The function get_default_image() is moved from icon.c to wdefaults.c because
it is now used in both places. This function is now splitted, to find the file
(get_default_image_path) path and the file image (get_default_image)
2012-11-04 12:54:15 +00:00
Rodolfo García Peñas (kix)
206fe5e821 Changed get_default_icon_rimage function name
The function get_default_icon_rimage name is not correct, because
the function doesn't return the default icon rimage, returns the
rimage from a file name. So the correct function name should be
get_rimage_from_file.
2012-10-28 10:58:43 +00:00
Rodolfo García Peñas (kix)
bef6555b6a noDefault changed to default_icon
The functions wDefaultGetIconFile(), get_default_icon_filename() and
get_generic_value() use the argument noDefault in order to avoid searching the
default icon. This double negation is difficult to read though. This patch
changes it to be True if the default icon should be included or false if not.

This patch changes the noDefault argument to default_icon, then the
True is now False and False is True.

The main change is at get_generic_value():

-       /* Search the default icon name - See noDefault argument! */
-       if (!value && !noDefault) {
+       /* Search the default icon name - See default_icon argument! */
+       if (!value && default_icon) {

Because the functions wDefaultGetIconFile() and get_default_icon_filename()
mainly forwards the noDefault argument to get_generic_value().
2012-07-18 11:12:01 +01:00
Rodolfo García Peñas (kix)
2e7b7b7e02 Removed WScreen argument in wIconValidateIconSize
This patch removes the argument WScreen in wIconValidateIconSize,
because is not used.
2012-07-16 02:06:36 +02:00
Rodolfo García Peñas (kix)
76e8a8f963 wDefaultGetImage splitted
The function wDefaultGetImage() is splitted in two:

1. get_default_icon_filename(): This function returns the full
   path of an icon. The function searches the icon in the database
   using instance and class.
2. get_default_icon_rimage(): This function returns the RImage for
   a given image path (full path). This function validates the icon
   size, so the icon is fully usable.

The function get_default_icon_filename() now adds the .app icons in the
search (using wApplicationExtractDirPackIcon()). To do it, the command
should be included, because this function searches '"command".app' icons.
Setting the command to NULL, this case is not used.

To do it we need the function wApplicationExtractDirPackIcon() defined
at appicon.c, so we need set the function as non-static and provide their
prototype in appicon.h.

This patch also includes an extra pointer check at wDefaultGetStartWorkspace
to make sure that WDWindowAttributes exists.
2012-07-04 21:13:54 +02: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)
d6db53af0b Remove unused argument from wDefaultGetIconFile()
The function wDefaultGetIconFile() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:44:40 +02:00
Rodolfo García Peñas (kix)
fd07a6bb36 Remove unused argument from init_wdefaults()
The function init_wdefaults() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:42:40 +02:00
Rodolfo García Peñas (kix)
c61e5bfeb8 Function wDefaultFillAttributes() rewritten
The function wDefaultFillAttributes can be changed a lot:

1. Initialitation to NULL: If the pointers are initialized to NULL
   then, the "if's" don't need the else block:

   WMPropList *value, *dw, *dc, *dn, *da;
   dw = dc = dn = da = NULL;

   if's:

   = if (instance)
   =     key2 = WMCreatePLString(instance);
   - else
   -     key2 = NULL;

2. Added StrConcatDot in the class + instance block:

   = if (class && instance) {
   +     buffer = StrConcatDot(instance, class);
   -     buffer = wmalloc(strlen(class) + strlen(instance) + 2);
   -     sprintf(buffer, "%s.%s", instance, class);

3. init_wdefaults(scr); moved above. This function is used only
   to load the default value "AnyWindow" (value "*"), to search
   the default value. Can be moved above without problems.

4. Preprocessor code of APPLY_VAL moved to the top of the file.

5. New function get_value_from_instanceclass() to do the rest of
   the (repetitive) code. This function is called to create the
   proplist, search the value, and return the proplist.

EXTRA:

1. Added StrConcatDot (like dot 2) in wDefaultChangeIcon()
2. Added a comment in get_value()
2012-06-09 16:48:58 +01:00
Rodolfo García Peñas (kix)
32fe186c54 WScreen argument removed in get_generic_value()
The argument "src" is removed in the function get_generic_value()
because it is not used.

The function wDefaultGetIconFile() is moved close to
wDefaultGetStartWorkspace() because both are similar.
2012-06-09 16:33:11 +01:00
Carlos R. Mafra
4e2ee27bfa Fix wrong wfree() use
There is a bug which happens when one modifies the "Initial Workspace" in the
"Attributes..." menu. Upon saving the change wmaker segfaults.

Commit ad373ef0dd ("WindowMaker: New function wGetWorkspaceNumber")
used wfree() in variables which were not wmalloc'ed. Fix this.
2012-04-26 11:11:32 -03:00
Rodolfo García Peñas (kix)
ad373ef0dd WindowMaker: New function wGetWorkspaceNumber
The new function wGetWorkspaceNumber returns the workspace number
for a given workspace name.

The code of this function is already used in session.c and wdefaults.c
and now is moved to workspace.c

In wSessionRestoreLastWorkspace the char value is checked before
calling the function, because without string, the function don't do
nothing.
2012-04-15 23:15:20 -03:00
Rodolfo García Peñas (kix)
aab9028fc2 Coding-style cleanup
Code style cleanup in multiple files. Tabs, spaces, curly brackets,...
2012-03-30 19:50:10 +01:00
Iain Patterson
07a0639c93 Don't shrink icons in switchpanel.
Icons in the switchpanel are constrained to the value of the IconSize
preference but the grid in which they are arranged is fixed at 64 pixels.
If IconSize is less than 64x64 the panel will show smaller icons with a
wide spacing, which looks pretty stupid.

Fix it by forcing the switchpanel to attempt to load images at the size
it's going to use.  The icon it actually gets may of course still be
smaller.
2012-02-16 09:13:01 +00:00
Rodolfo García Peñas (kix)
a2c297e6a7 Remove unused variables 2012-01-28 14:54:07 +00:00
Carlos R. Mafra
8ba6118c2e Make 'no miniaturizable' window property user-configurable
The flag to not let windows be minimized was already defined in
WM (it's called 'no_miniaturizable') and the minimize functions
respect it. However this flag can not currently be set manually.

As can be read in the NEWS file

  "NotMiniaturizable option changed to NoMiniaturizeButton"

it seems that the "non miniaturizable" property was a first-class citizen
in ancient times and probably configurable (those changes do not appear in
the old CVS history).

Let's make this property be user-configurable through the "Advanced Options"
panel.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2011-08-11 13:30:44 +02:00
Tamas TEVESZ
f6fefbd9b6 Partial fix for focus stealing
By turning M'bert's d6c134 around a bit and adapting the surroundings,
allow _NET_ACTIVE_WINDOW only if fulfilling it doesn't cause annoying
unwanted changes in the workspace. This is now the default behaviour;
unconditional focus stealing can be enabled on a per-client basis in the
Advanced Options window menu ("Focus across workspaces").
2011-04-18 13:23:22 -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
Haroldo Santos
c82138eab9 switchpanel: Add skip_switchpanel advanced option
Some applications running in my machine are only background
windows, e.g.: screenlets showing CPU usage.

In current wmaker version all these applications pollute my
switchpanel, so I wrote this patch (thanks Carlos for the helping me).

It includes an additional advanced option for windows "Do not
include in switchpanel" which, if set, allows applications to
not appear in the switchpanel.

Signed-off-by: Haroldo Santos <haroldo.santos@gmail.com>
2011-02-17 19:29:15 +01: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
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
35bcfa6a02 Fix internationalized format string warnings
A few internationalized format strings have only one %s in the default
while two strings are being passed. Change those defaults to have two
%s's, which means we also have to update the .po files to match. May as
well throw in the extra %s in the translated version while we're at it.
2010-04-09 15:16:31 +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
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
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
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
  have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
2002-01-04 07:32:37 +00:00
dan
a8c7375623 Fixed problem with kcalc not having a miniaturize button 2002-01-04 00:30:11 +00:00
dan
41996df786 - Saving a domain file will first strip all entries that are also present in
the global domain as well and are exactly the same. This fixes a bug where
  settings from the global domain file were merged in the user domain file
  and further changes in the global domain file for those merged values was
  ignored making a system admin unable to set global defaults for all users
  using the global domains.
- Fixed bug with not extracting the icon from the client when using
  shared appicons.
- Added WMSubtractPLDictionaries() to WINGs (opposite for merging, it will
  remove all entries from dest if they are present in source and are exactly
  the same. Unique entries in dest and entries with different values from
  those present in source will be preserved).
2001-12-20 22:16:01 +00:00
dan
90c77b1a45 - improved behaviour for the shared appicon thing.
- added a 'Bool recursive' flag to WMMergePLDictionaries() in WINGs
2001-12-17 14:46:31 +00:00
dan
672c42cc48 - removed the collapse appicons thing
- added real appicon sharing (apps of the same kind will have a single
  shared appicon).
2001-12-17 04:02:33 +00:00
dan
8cb297a671 small cleanup 2001-10-10 18:52:14 +00:00
dan
33cc542e85 - Finished moving to the new proplist handling code in WINGs.
- Also tested the backward compatibility ability of the WINGs proplist code
  which seems to work quite well.

Starting with this moment, Window Maker no longer needs libPropList and is
now using the better and much more robust proplist code from WINGs. Also the
WINGs based proplist code is actively maintained while the old libPropList
code is practically dead and flawed by the fact that it borrowed concepts
from the UserDefaults which conflicted with the retain/release mechanism,
making some problems that libPropList had, practically unsolvable without a
complete redesign (which can be found in the more robust WINGs code).
2001-10-04 03:07:34 +00:00
kojima
d06532cb3e added collapsing option 2001-02-11 04:29:30 +00:00