This patch is updating the coding style based on checkpatch output
and as suggested by Rodolfo it also inverts the condition test
in getAnimationGeometry fct to return earlier when possible.
This patch is fixing the RenderBadPicture X errors on deiconifying
window using double-click.
Background:
I also experienced this issue these days, after checking it was not
introduce with latest apercu feature I decided to dig into it.
As far as I saw in the archive it was first reported by Rodolfo in June 2012.
Each time a window is deiconify using double-click, the error below
is reported in the session error log:
wmaker(catchXError(startup.c:177)): warning: internal X error:
RenderBadPicture (invalid Picture parameter)
Request code: 152
Request minor code: 7
Resource ID: 0x6000a4
Error serial: 9269
So I decided to track when the issue is happening,
from src/action.c wDeiconifyWindow then in src/icon.c wIconDestroy
then in src/wcore.c wCoreDestroy.
At that stage, all the structures I checked are cleaned up properly
during the icon destroy process.
So I also checked when the issue is generated, I ended in
wrlib/xutil.c RCreateXImage (in the share memory extension code)
XSync(context->dpy, False);
oldErrorHandler = XSetErrorHandler(errorHandler);
XShmAttach(context->dpy, &rximg->info);
XSync(context->dpy, False);
XSetErrorHandler(oldErrorHandler);
At this point I was quite lost, cause it means the error could
have been in the server error queue already.
Facts, seems the issue is appearing only on double-clicking the miniwindow,
but not when "Deminiaturize" is clicked from the right-click contextual menu.
I also checked the code from winmenu.c when the action MC_MINIATURIZE
is selected from execMenuCommand fct, but it was just calling
wDeiconifyWindow function. Hum.
So, after one full day of thought I tested to just change the focus before
double-clicking the miniwindow, and bingo it works.
That means when the icon is destroyed the X server still has a reference
on it that's generating the issue.
This patch is adding miniwindow apercu when the mouse
is over the miniwindows.
To enable it you have to run WPref, in Miscellaneous Ergonomic
Preferences, check miniwindow apercus.
Then, you will be able to see a screenshot of the app when the mouse
is over the miniwindow.
This patch adds "FrameFocusedBorderColor" option for theming,
It should allow having borders better matching titlebar colors.
By default it's set to black.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Functions placing windows (PlaceWindow - src/placement.c, wMaximizeWindow -
src/actions.c) need to calculate area differently than ones placing icons
(PlaceIcon - src/placement.c, wArrangeIcons - src/actions.c).
So this patch puts adjustment code in wGetUsableAreaForHead which is
used by all those functions but called with different 'bool noicons'
argument depending on if it's called in window or icon placement
function.
Reported-by: Carlos R. Mafra <crmafra@gmail.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Fixes bug report:
The 0.80.2 and older versions allowed the miniwindows to lay down in
parallel with wmdock (if one wanted it that way) but newer Windowmaker
versions could only partially simulate such behavior and that includes
to either setting an option NoWindowOverDock to yes or to manually set
the dock to "Keep on Top".
Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
When animations are disabled, we still create the function but we make it
empty to keep the rest of the code simple. This patch does:
- mark the function inline, to increase the probability that the compiler
will not generate the function at all;
- mark arguments as unused to avoid some compilation warnings.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Windows which enter fullscreen mode were not automatically given focus.
Usually that didn't matter because they already had focus when they
switched modes. An example of unexpected behaviour is opening a media
file in an already-running vlc from the commandline or via a file manager.
vlc would fullscreen mode but the launching application would retain focus.
Note that if vlc were not already running and it was launched as
described above, it would receive focus when it was opened and thus
retain focus going into fullscreen.
We now track which window had focus before a window enters fullscreen
mode and focus the original window afterwards. In the (usual) case
where the window going fullscreen already had focus, nothing changes.
In the rarer case where the window going fullscreen didn't
have focus, it will gain focus temporarily then yield to the originally
focussed window when it leaves fullscreen mode.
To reproduce:
* Launch vlc and configure it to switch to fullscreen when playing a
movie and to disallow multiple instances.
* Switch to a terminal and type 'vlc /media/funny_cats.mp4' or use a
file manager to open funny_cats.mp4 with vlc.
* Press space to pause the movie. Nothing happens because the
terminal/file manager still has focus.
The appicon list is moved out of WScreen. The reason is because
the appicon list is used to create and remove icons (appicons, dock,
clip,...) on the screen, but these icons are not associated with the
WScreen. These icons are associated with the Workspace.
If we check the WWorkspace struct we can see that the Clip is inside
this struct. The dock, the background, the workspace name are other
items related to the Workspace, not with the screen.
So, we should take out the appicon from the WScreen. But, what is the
better place to hold it? The workspace? NO!, because the icon list
is common to the all workspaces. Probably the better place is hold
as independent list in the global namespace, so this is my option.
In the next patches we can see that this is the better option, because
we can create the icons, without think where we should paint them.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
The variable current_workspace, that contains the current workspace
is moved to the global workspace properties.
Now the screen is not needed to know the workspace_count.
When an application steals focus and switches workspaces autonomously,
"ignore workspace change" does not get reset. Since I didn't want to
track down the exact case I thought it best to reset the flag in all
cases, as it probably should be.
> How did you discover this? What was the behavior you saw?
After saving files in avidemux, the "Done" dialog pops up, and with it the
entire application is moved to the current workspace. After this, using the
mousewheel on the root window or using the appropriate key combination does
not change the workspace anymore, only using the arrows on the clip works.
And, as mentioned on the mailing list, just starting emacs (22.3.1) also
provokes this bug. Using a Debian/Sid system btw.
wMaximizeWindow() was previously rewritten and simplified.
Unfortunately the rewrite introduced a regression with windows which
were horizontally maximized or Maximusized, whereby they would be too
small after the maximization.
The bug is easy to see by opening a standard 80x24 terminal and hitting
the maximize horizontally shortcut. The terminal shrinks to 21 lines.
Pressing the shortcut key again correctly restores it to 80x24.
The fix is to refrain from shrinking the final window height, which is
done to account for its frame border and titlebar, for the affected
maximization styles.
The file event.h includes the function prototypes for event.c.
The prototypes included were moved from funcs.h.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
new window positions top left, top right, bottom left and bottom right
these new maximized positions are combinations of left, right, top and
bottom maximized positions
if a window was at x=0 or y=0, the original condition return
false and the window is not moved to original position,
but if width or height from old_geometry is set then wmaker
already saved old_geometry, and we can trust x=0 or y=0 is
original position.
- remove extern declaration in source file, use header instead
- add inclusion of header defining the functions of the file to
get the compiler to cross-check them
- marked static the functions that should not be visible ouside
their file
These functiosn were renamed:
wIconCreateCore to icon_create_core
wIconCreateWithIconFile to icon_create_for_dock
wIconCreate to icon_create_for_wwindow
Using window-supplied depth, visual and colormap information has the
side effect of causing window borders to be draw using inconsistent
colormap entries. Allocate entries from each window's colormap when
drawing its border.
Force setting the border when the window is first created so it's
guaranteed to be drawn in a consistent state.
Update the saved X co-ordinate of a window which was moved when
maximized (only) vertically so that unmaximizing the window restores
its dimensions without warping it back to its previous X position.
Similarly update the saved Y co-ordinate of a window which was
moved when maximized (only) horizontally.
Handle Maximus as a special case. We remember the Maximusized X and Y
co-ordinates then adjust the restored co-ordinates relative to the
delta between the window's position just after Maximusizing and its
position just before restoring. So for example if a window is
Maximusized, moved 100 pixels to the left and restored, it will end
up 100 pixels left of its original geometry.
Also fix "jumping window" bug reported by Christian Wittmer:
This "jumping window" happens only when you
1) open new xterm (STRG +n)
2) current position is (+64, +0)
3) maximize window vertically
4) undo maximizing
5) move window to the right or left (up or down as you like)
I moved right to (+450, +0)
6) maximize vertically again
7) and undo maximizing
8) window jumps back to (+64, ..) position
If you move a new opened window to a new position (e.g. +200, +200)
and then start with "3)". window is jumping back "+200, +200"
The functions related to colormap are moved from funcs.h to the new
file colormap.h. These files are included where needed.
The functions wColormapInstallRoot and wColormapUninstallRoot are
removed, because they are not used.
Making all in src
CC actions.o
actions.c: In function ‘wMaximizeWindow’:
actions.c:421:14: warning: ‘maximus_height’ may be used uninitialized in this function [-Wuninitialized]
actions.c:440:29: warning: ‘maximus_width’ may be used uninitialized in this function [-Wuninitialized]
actions.c:442:35: warning: ‘maximus_y’ may be used uninitialized in this function [-Wuninitialized]
actions.c:454:18: warning: ‘maximus_x’ may be used uninitialized in this function [-Wuninitialized]
CCLD wmaker
These warnings were harmless because they were at a point where
find_Maximus_geometry() had already been called. So let's simply initialize
them to zero to silence gcc.
Fons Adriaensen reported that:
> WM's 'unshade' seems to use multiple Expose events [...] even when
> all animations and 'superfluous effects' are disabled.
Typo in shade_animate() could cause windows to be animated when the
no_animations preference was set. With this patch I see fewer
XMoveWindow() calls and quicker shading.
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.
From the original report by Tamas Teves:
"i'm having (and have, for a long time) problems with openoffice and
java-based (perhaps only netbeans-based?) apps.
for openoffice, any menu opens in the far right edge (with xinerama,
on the far right edge of the rightmost display) of the display. it
then can be clicked and operated corretly where it appears.
as for netbeans (and jswat, which also uses netbeans platform as a
base), it's a bit more complicated, but let me try to describe. start
netbeans so that it is not maximized and not in the upper left of the
display. it works fine. move it around, still works fine, resize,
still works fine. now if i maximize it (not by moving to the upper
left corner and resizing, but by the maximize shortcut), then the
menus start acting weird. it seems that the actual position of the
mouse pointer and the hot spot of the mouse pointer get "out of sync"
so to speak, as if the hot spot stayed where the window was before
maximization.
i've made a capture which hopefully better shows what i'm trying to
say. this is a netbeans window maximized, while i'm trying to click
tools->options. the left mouse button must always be held down, or
else it instantly loses any interaction with the menus (in the capture
i released it once when i completely lost track of where i might be).
the capture is available at http://dawn.dev.hu/~ice/tmp/wmjava.avi
i'm not sure whether java stuff other than those based on netbeans
platform exhibit this behaviour. i've seen this with at least one
other nb platform stuff as well."
The fix is to call wWindowSynthConfigureNotify() after wWindowConfigure()