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

2449 Commits

Author SHA1 Message Date
Alexey I. Froloff
d53b43608a wmmenugen: properly skip NoDispaly entries
Last group from a desktop file is always added to menu regardless of
NoDisplay property.  Properly handle the NoDisplay and Hidden properties
at the end of file.

Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
2012-06-18 23:34:46 +01:00
Rodolfo García Peñas (kix)
def62293e9 New debian version 0.95.3-2
* Hardening
* Upload allowed for maintainers
2012-06-18 23:26:39 +01:00
Rodolfo García Peñas (kix)
089c99941f Icon painting moved to makeAppIconFor()
The icon painting is moved to the function makeAppIconFor()
including the check for no_appicon.

wAppIconCreate is now static because is only used in makeAppIconFor()
2012-06-18 23:25:34 +01:00
Rodolfo García Peñas (kix)
ee450acb30 Change a small comment in icon.c
The path of the CacheIcons is defined at CACHE_ICON_PATH. The path
~/GNUstep/Library/WindowMaker/CachedPixmaps can be changed in a future
and the comment is incorrect.
2012-06-18 23:22:22 +01:00
Rodolfo García Peñas (kix)
50765fab84 GetProgramNameForWindow removed
The function GetProgramNameForWindow is no longer used, so it can be removed.
2012-06-18 23:21:07 +01:00
Rodolfo García Peñas (kix)
fbd9c12cd0 Do static icon functions
The functions wApplicationSaveIconPathFor() and wApplicationExtractDirPackIcon()
are now used only in appicon.c and can be static.
2012-06-18 23:16:14 +01:00
Rodolfo García Peñas (kix)
e3b9026532 save_app_icon WWindow argument removed
The argument wwin (WWindow) is not used in save_app_icon, so it can
be removed.
2012-06-18 23:15:28 +01:00
Rodolfo García Peñas (kix)
1fbce07805 extractIcon removed.
The function extractIcon is removed, and its behaviour is moved to
save_app_icon, because this function is always called.

To do that, save_app_icon doesn't need to check if the icon is saved (it's
done at wIconStore). The icon now is saved always (if it doesn't exist),
like extractIcon() used to do.
2012-06-18 23:14:10 +01:00
Rodolfo García Peñas (kix)
bc0700e016 Create WAppIcon always
When the application is created, the WAppIcon now is created always,
but it is only painted if the flag is not set.

The icon initialization to NULL can be done now at app_icon_create_from_docks
because it is always called.
2012-06-18 22:58:55 +01:00
Rodolfo García Peñas (kix)
a08adcd283 app_icon_create_from_docks moved to appicon.c
The function app_icon_create_from_docks is moved to appicon.c, because
it is a function to create application icons.

The static function findDockIconFor is moved too because it is only used
at app_icon_create_from_docks().
2012-06-18 22:52:49 +01:00
Rodolfo García Peñas (kix)
f8158d047a wAppIconSave splitted
The function wAppIconSave is splitted in two functions:

wAppIconSave() + save_app_icon_core()

The function save_app_icon_core will be used in other functions as
common code.
2012-06-18 22:50:25 +01:00
Rodolfo García Peñas (kix)
de68ee6f1b wAppIconSave is now void
The Bool value is not used, therefore it suffices to return void.

wAppIconChangeImage is removed from appicon.h, because it is not implemented.
Small code cleanup for wAppIconCreateForDock at appicon.h.
2012-06-18 22:33:10 +01:00
Rodolfo García Peñas (kix)
f44944c18d Icon functions moved to appicon.c
The icon functions wApplicationExtractDirPackIcon() wApplicationSaveIconPathFor()
are moved to appicon.c from application.c.

This functions are Application Icon related and should be included in appicon.
2012-06-18 22:25:57 +01:00
Rodolfo García Peñas (kix)
7f022f1c8f Remove code duplication by calling get_name_for_instance_class()
The code in application.c to create the icon name is
included in icon.c (function get_name_for_instance_class).
2012-06-12 00:15:33 +01:00
Rodolfo García Peñas (kix)
cedf620543 New function get_name_for_instance_class
The function get_name_for_icon is renamed to get_name_for_wwin.

The previous contents of get_name_for_icon are now at the new
function get_name_for_instance_class.
2012-06-12 00:15:20 +01:00
Yuri Karaban
9d3d34599f Add "Center" window placement strategy
Center strategy: try to put window at the center of the usable area. If
window would overlap with existing windows, fall back to "Auto"
placement strategy.

It's very useful for fresh workplaces.
2012-06-10 18:25:47 +01:00
Rodolfo García Peñas (kix)
1a594de74e Remove code duplication by calling readGlobalDomain()
The code in defaults.c to get the shared database is
included in the same file (function readGlobalDomain).
2012-06-10 12:27:27 +01:00
Rodolfo García Peñas (kix)
f8291de919 Function get_name_for_icon splitted
The function get_name_for_icon returns now the name of the icon,
without the full icon path and without extension (.xpm). Now is
not static.

The full path, including the folder creation, is done now by
wmkdirhier() (WINGs). This function is much better, because
supports "infinite" folders, not like the old get_name_for_icon
which could only create the specific folder for Cache Icons.

Using this functions, wIconStore() do the same work, but in a better
way, more clear.
2012-06-10 00:30:14 +01:00
Rodolfo García Peñas (kix)
7ef416f8ac New functions in icon.c
This patch creates some functions:

1. Rename getnameforicon() to get_name_for_icon()
2. New function get_icon_cache_path, to get the icon cache folder
   ($HOME + GNUstep/Library/WindowMaker/CachedPixmaps). This folder
   is defined now in the preprocessor. Not used yet, in next commits.
3. New function get_wwindow_image_from_wmhints to read the image from
   X11 wmhints. Previous code at wIconStore() now changed.
2012-06-10 00:01:55 +01: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
Amadeusz Sławiński
910a851f35 Fix "implicit declaration of function" 2012-06-03 18:00:38 +01:00
Amadeusz Sławiński
fc5c0fe1a4 Add fill screen scale to wmsetbg
I noticed that I can have different background with wmmsetbg for each
desktop and wanted to use it, but it was missing option to fill the
screen with proportionally scaled image, so here it is.
2012-06-03 17:02:30 +01:00
Rodolfo García Peñas (kix)
21a5f41c08 New function create_logo_image
New function create_logo_image to set the logo image.
2012-06-02 20:58:58 +01:00
Carlos R. Mafra
202b9eadc5 Random coding style cleanup in winspector.c 2012-06-02 20:14:47 +01:00
Rodolfo García Peñas (kix)
e8074ae1cd Remove code duplication by calling removeAppIconFor()
The function removeAppIconFor() does exactly the same thing as the code inside
wApplicationDestroy(), including the last call to wArrangeIcons(). So let's
simply remove the code and call the function instead.
2012-06-02 20:05:14 +01:00
Rodolfo García Peñas (kix)
fbab31b798 Coding style cleanup in application.c
Changes to application.c:

- Curly brackets
- Code commented
- Include not used
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
dd6a54bba5 Check one time if no_appicon is set
This patch checks if the no_appicon flag is set, then, the icon
is not created, therefore cannot be painted neither saved.

Some comments added to clarify the code.
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
bd3fb21441 Remove code duplication by calling paint_app_icon()
The code in application.c to create+paint the application icon is
included in appicon.c (function paint_app_icon).
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
2e7b039558 Split makeAppIconFor()
The function makeAppIconFor is splitted in two:

makeAppIconFor: Create the new icon if needed
paint_app_icon: Paint the icon
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
cab8bbc495 Move makeAppIconFor() and removeAppIconFor()
The functions makeAppIconFor and removeAppIconFor are moved from
winspector.c to appicon.c, and now are not static.

The reason to move these functions is because are used to create
and remove app_icons, therefore should be included in this file.

Finally, this functions will be updated and splitted in next patches.
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
01ea1fa8b4 New function app_icon_create_from_docks
The new function app_icon_create_from_docks do all the needed stuff to create
the application app_icon using a previous image in docks.

The contents of the app_icon_create_from_docks were moved from the
wApplicationCreate function. Now this function is more clear.
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
1c1697dc40 New function save_app_icon
New function to save the icon "save_app_icon". This function is
created in appicon.c, because is related to app_icons. The contents
are from application.c. No important modifications are included in
this function. Removed the includes not needed.
2012-06-01 22:01:02 +01:00
Rodolfo García Peñas (kix)
423b78811a Initialize app_icon to null
The app_icon initialization to null is common in the if and else blocks.
2012-06-01 22:01:02 +01:00
Christophe CURIS
e498a8bd79 Fixed possible off-by-one loops
Due to variable size definitions in the structure, the 'for' loops may
actually try to work on wrong data. Instead of using hard-coded value,
we now simply let the compiler give us the number of elements.

This may (or may not) fix a crash reported by Rodolfo kix Garcia.
2012-05-31 23:13:07 +01:00
Iain Patterson
d356baebea Bugs with readMenu*().
readMenuPipe() was calling freeline() on stuff which might be uninitialised, causing
a crash if no valid input was read.

readMenuPipe() was trying to snprintf() on an uninitialised pointer.  We now use a
fixed-length buffer like the other readMenu*() functions.

Various memory leaks in readMenu*() functions have been fixed.  There
are still some lurking around but most have been removed.

The original report from Charles Philip Chan <cpchan@bell.net> on 22 May 2012 says
that:

"Window Maker crashes when I try to open a sub-menu auto-generated by using:
 xdg_menu --format WindowMaker --charset UTF-8"

There was also a report from Amadeusz Sławiński <amade@asmblr.net> on 24 May 2012
stating that wmaker crashes using:

% cat test.sh
cat << EOF
Test MENU
stuff EXEC true
Test END
EOF

% grep test GNUstep/Defaults/WMRootMenu
  ("Generated Submenu", OPEN_MENU, "|| /home/amade/test.sh")

Error is:
wmaker(MonitorLoop(monitor.c:134)): warning: Window Maker exited due to a crash (signal 11) and will be restarted.
2012-05-29 15:24:12 +01:00
Rodolfo García Peñas (kix)
3eb8c9d498 Added wmlib/libWMaker.la to .gitignore
The compiled library file wmlib/libWMaker.la is included
in the .gitignore file, to forget it in the git status command.
2012-05-28 12:32:02 +01:00
Rodolfo García Peñas (kix)
284d3b56fe debian: New version 0.95.3
This patch includes the changes to create the package for
debian.

Changes are included in changelog:

  * New upstream release 0.95.3
    * Removed debian/clean file. Upstream removes now the files.
  * Bumped to standard version 3.9.3
  * Important!: Removed symbol "W_DraggingInfo" in libwutil2 and
    libwings2, because the struct W_DraggingInfo is now declared
    as "typedef", therefore the struct is not included.
    This change is included in upstream, see line 126 of the file
    WINGs/WINGs/WINGsP.h
  * Patch 53_Debian_WMState.diff changed, because the WMState file
    in upstream is now different. Now, the dock launch WPrefs.
  * Removed /etc/X11/WindowMaker files.
    * Removed from debian/wmaker-common.dirs
    * Removed (duplicated) files in debian/wmaker-common.install
    * New path for menu.hook: /usr/share/WindowMaker
      * Changed in the menu-method files (wmaker and wmappearance.
    * Removed menu.posthook and menu.prehook.
  * Changed the menu behaviour. Applications/* contents moved to
    the root menu.
2012-05-28 12:31:54 +01:00
John H. Robinson, IV
968ebdedf2 Makefile: Add missing subdir
The test suite was added, but it wasn't included in the list of
directories to be included in the tarball, so ./configure fails:

config.status: error: cannot find input file: `test/Makefile.in'

The following patch adds the missing test suite.
2012-05-24 08:08:12 -03:00
Carlos R. Mafra
efcad8497e Window Maker 0.95.3 wmaker-0.95.3 2012-05-16 08:31:01 -03:00
Tobias Stoeckmann
97f68b5865 Fixed typos 2012-05-07 20:49:42 -03:00
Tobias Stoeckmann
883600748e Major overhaul of rootmenu's file handling.
This diff fixes a huge amount of issues that could be triggered by using
the old-fashioned configuration files, i.e menu.  They can be activated
by using a line like "/path/to/menu".  On most systems, this file will be
parsed with cpp and the result sent through a pipe to WindowMaker.

Anyway, in the code path, memory leaks and buffer overruns await. I have
tried to fix these parts, but in the end it is more or less a rewrite,
whereas I used WINGs whenever possible.

Difference to previous implementation, beside of bugfixes:
- You are free to use single quotes and double quotes in configuration
- Linewrapping is allowed for other pipe'd data, too
- In general, line reading is unified throughout that file

Bugfixes:
- Avoid buffer overrun on lines which have line wrappings, that will happen
  ALWAYS, because wtrimspace-usage was erroneously.
- Avoid memory leak, also happened through wtrimspace usage.
- Avoid buffer overrun in separateline if a line ending happens early.
- Actually handle ferror() instead of only feof(), that would result in
  endless spinning
- A line wrapping at the end of a file is an error.
2012-05-07 20:49:15 -03:00
Tobias Stoeckmann
9e2d1b3ecf Don't fail with assert() in string functions if both strings are NULL.
wstrconcat and wstrappend already support situations in which first OR
second string are NULL, but not if BOTH are NULL.  Fixed that.
2012-05-07 20:47:22 -03:00
Tobias Stoeckmann
4a4775f076 Fixed memory leak in wWorkspaceRename.
The function wtrimspace returns a wmalloced memory region, therefore
it must be wfreed after usage again.

Please take note that this also happens with every single line
of menu files, which will get fixed in a separate commit.
2012-05-07 20:46:12 -03:00
Tobias Stoeckmann
33328d997e Avoid buffer overrun in parseMenuCommand.
In parseMenuCommand, title[300] might get filled with a string of length
300.  The string is copied with strcpy, therefore the size would have to be
301 or -- as I propose -- the fixed value 300 gets replaced with
"sizeof(title) - 1".  This shows also that the size 300 belongs to title
and it will already be replaced during compile-time into 299.
2012-05-07 20:45:13 -03:00
Tobias Stoeckmann
6bc550d91b Remove curly brackets
...as they were completely wrapped up by another pair of curly brackets.
2012-05-07 20:42:34 -03:00
Tobias Stoeckmann
cbff60297e Easier code path in appIconMouseDown 2012-05-07 20:41:18 -03: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
b5df97db95 Removed unused "buffer" variables. 2012-05-07 20:36:58 -03:00