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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Avoid some pitfalls with window maximization and make it behave more
intuitively. We now treat a window's vertical and horizontal
maximization as separate properties and only remember its original
geometry in a particular direction when it actually changes. We also
deliberately do not remember a window's geometry when it changes from
one maximized state to another. As a result windows can be more
reliably restored to their original size.
For example the "Maximize active window" hotkey followed by the
"Maximize active window vertically" hotkey will now result in the window
being maximized horizontally only, whereas previously the second hotkey
would have no effect because the window was already maximized
vertically. In addition selecting the Unmaximize window menu in the
same example will now result in the window being restored to its
original size. Previously the unmaximize attempt would have no effect
because the vertical maximization would have remembered the window's
"original" geometry when it was fully maximized.
Maximus is handled separately. The "Maximus" hotkey will now toggle
Maximus mode regardless of the window's current maximization state. For
example if two unmaximized windows are on screen and one is Maximusized
it will fill the space left by the second window, as before. But if the
first window is maximized and the "Maximus" hotkey is pressed the window
will now fill the same space as if it were Maximusized from its original
size. Previously the window would not change size from its fully
maximized state because the Maximus algorithm would consider
fully-maximized to be a valid Maximus size.
Xrandr support is currently very primitive and stupid, but people
do not seem to be aware of its problems and still enable it in distros.
Try to scare them to not do that.
This reverts commit cbe2f4e61a.
The reason for the revert is the regression reported here:
http://marc.info/?l=openbsd-ports&m=133151145814675&w=2
I've been able to reliably reproduce the double-spawning of
xterms I've been seeing. The bad news is that it still happens
even with a fresh configuration directory.
To reproduce:
0) Create a keyboard shortcut if one does not already exist (I'm
using <ctrl>+u set to spawn an xterm)
1) Open WindowMaker's preferences.
2) Click on "Applications Menu Definition" (it's the icon
immediately to the left of the keyboard icon)
3) Click save, and then close.
4) Keyboard shortcuts will spawn two applications.
I use keyboard shortcuts to spawn xterms, browsers, and filemanagers.
All of them spawn twice after performing the above. To fix it,
<F12> or <right-click> -> Exit -> Restart.
If I repeat steps 1-3, three windows will spawn. Repeat again and
four windows will spawn etc. (I stopped after getting five to
spawn at once).
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 declaration of the structure actually also created an unused variable. This
variable was not used anywhere, and lead to symbol defined in multiple objects.
These symbol are silently merged by GCC, thus no problem was reported.
The issue was raised by Yves de Champlain when trying to compile with LLVM/clang
which is a bit stricter there.
The new function wIconCreateCore do the common work to create a WIcon.
This code was before in wIconCreateWithIconFile() and wIconCreateWithIconFile().
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.
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.
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.
Use the gcc-specific noreturn attribute to advise the compiler that
Exit() doesn't return. This is safe because we already use preprocessor
rules to hide __attribute__ from other compilers.
Suggested independently by Christophe Curis and Brad Jorsch.