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.
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.
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).
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)
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.
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().
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.
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()
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.
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.
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.
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.
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>
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").
* 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)
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>
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.
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.
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 :-)
- 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
- 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
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).
- 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).