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.
main.c: In function ‘RelaunchWindow’:
main.c:461:1: warning: control reaches end of non-void function
[-Wreturn-type]
Actually we can't reach the end of the function because the three
possible cases are Exit(-1), return False and return True. Of course if
Exit() were ever changed the above statement might become incorrect.
Some compiler food silences the warning.
Zoltan Balaton points out that Control + Doubleclick on docked app will
launch a new instance. For consistency with that behaviour we now allow
Control + Doubleclick on an undocked appicon to invoke the new
relaunching functionality.
We also now restrict doubleclick handling to the left mouse button in
order to avoid relaunching the application twice when the middle button
is used.
Use the WindowRelaunchKey shortcut to examine the WM_COMMAND property of
the active application's main window and launch a new instance of the
application using the retrieved command line.
The function canReceiveFocus should check if the window is no_focusable first.
If the window is not focusable but is miniaturized, the window is shown in the
switchpanel.
How to reproduce the problem:
- Open an application
- Open the window properties, advanced options
- Set that the application can not get the focus and save
- Test the switchpanel (Alt+Tab) the window doesn't appear
- Minimize the window
- Test the switchpanel (Alt+Tab), the window appears
- If the window is selected (restored), and test again the switchpanel, the window doesn't appear!
A new function is created to get the image from the X11 window.
The function updateIconImage is splitted in two blocks, one is moved
to get_wwindow_image_from_x11 with the X11 code, and other is used
to update the Application and Window icons (kept in the same function).
Doug Barton reported that using "Technical drawing-like" for "Size display"
under WPrefs "Miscellaneous Ergonomic Preferences" together with opaque
resize would lead to artifacts left on screen when resizing.
This patch fixes it (and it also fixes some minor coding style issues
in the surroundings).
The file "clean", which contains "WindowMaker/Defaults/WMRootMenu"
can be removed, because this file was included to be cleaned in
the commit 01907f9983
The Application/* items are moved to the root menu, removing the
"Applications" submenu. The files from /etc/X11/WindowMaker moved
to /etc/GNUstep/Defaults
(Window|Menu)Title(Min|Max)Height defaults options allow to set
minimum and maximum titlebar height.
For example, to force all titlebars to 24 pixels execute
following commands:
$ wdwrite WindowMaker WindowTitleMinHeight 24
$ wdwrite WindowMaker WindowTitleMaxHeight 24
$ wdwrite WindowMaker MenuTitleMinHeight 24
$ wdwrite WindowMaker MenuTitleMaxHeight 24
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>