EWMH 1.3 added various window types: dropdown_menu, popup_menu, tooltip,
notification, combo, and dnd. We may as well set appropriate defaults if
these types get set on a window that isn't override-redirect.
I'm not terribly attached to these defaults, except that the ones for
'notification' are what I set manually for xfce4-notifyd before deciding
to patch wmaker.
While we don't provide compositing ourselves, add-on compositors such as
xcompmgr need us to copy the _NET_WM_WINDOW_OPACITY property from the
client window to the frame window.
We can do this easily enough.
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The mechanism of Notifications in the WINGs toolkit is relying on
callbacks to dispatch notifications, which means having a fixed argument
list for the handling function.
It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The variable workspaces, that contains the list of workspaces
is moved to the global workspace properties.
Now the screen is not needed to know the workspaces.
The function getWindowState() doesn't need the WScreen argument.
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.
The variable workspace_count, that contains the number of workspaces
is moved to the global workspace properties.
Now the screen is not needed to know the workspace_count.
When using the formula [sizeof(array) / sizeof( x )] to get the number
of element in a static array, it is better to use array[0] for 'x'
instead of the base type of array:
- in case the base type would change someday;
- if the compiler were deciding to insert padding somewhere
The function wIconChangeTitle() now changes the icon title name
doing the full work (except painting it).
The function receives now the icon to change the name and the
wwindow with the new name. The function checks if icon and the
window exists.
Then, try to get the name using wNETWMGetIconName(), if not found
then try to read it from wGetIconName(). Then the icon has the new
name and the function returns.
This is better because:
1. We don't need a flag to know if the window got the name
using the wNETWMGetIconName function. Now call this function
always.
2. We do the same work in all calls to the wIconChangeTitle()
function.
The functions that uses wIconChangeTitle (at client.c, icon.c and
wmspec.c) uses always the value set by wNETWMGetIconName() first,
else, the value set by wGetIconName(). This is the reason for the
flag net_has_icon_title. Now the flag can be removed.
The function wIconUpdate can receive a image to setup as icon image.
If image is NULL, then use the original method, using different procedures
to get the image.
The function get_wwindow_image_from_x11() is renamed to get_window_image_from_x11()
and does the same work, but now its argument is a Window struct instead of a
WWindow.
This change is better because it allows objects with Windows (but without
WWindows) to call this function.
The function now is not static to allow its use in other parts of the code.
Respect _NET_WM_STRUT and _NET_WM_STRUT_PARTIAL from all windows, not
just WWindows. This will allow us to respect struts from app icons
and dock icons.
Window Maker already supports the _NET_WM_STRUT property as described
in the EWMH spec. We respect client-provided struts and avoid placing
or maximizing windows over those areas. An example is that we don't
try to place or maximize windows where they would be obscured by an
always-on-top gnome-panel.
_NET_WM_STRUT is now deprecated and redefined as a special case of
_NET_WM_STRUT_PARTIAL, which allows variable strut widths. A panel at
the bottom of the screen, for example, does not have to reserve the
whole width as a strut if it does not fill 100% of the screen width.
By default the XFCE bottom panel does not extend the whole width of
the screen, for instance.
Our method for restricting parts of the screen from placement doesn't
have a way to account for struts which are not 100% tall or 100% wide,
so until now we have ignored partial struts. In the case of the XFCE
panel mentioned above, the result is that a window may maximize
underneath the panel and be obscured.
As a partial hackaround we now query windows for _NET_WM_STRUT_PARTIAL
but throw away the start and end co-ordinates, assuming instead that
the struts are full-width/full-height. This trades off a small amount
of wasted placement space to avoid the case where windows can be
partially obscured by panels, which can be particularly annoying if
the panel is at the top and the victim's titlebar becomes hidden.
This patch do these changes:
1. Removes the extra curly brackets
2. Add curly brackets if needed (code style)
3. Removes spaces in the function prototypes/declaration
I think this is the best moment to do it, all together
in a style clean patch.
4. Moves variable definition with the same type to the same line
The function wNETWMCheckClientHintChange returns a Bool,
but this value is never used, son can be removed.
This function now is void.
kix@osaka:~/src/wmaker/wmaker-crm-tosnd/src$ grep wNETWMCheckClientHintChange *.[ch]
client.c: wNETWMCheckClientHintChange(wwin, event);
wmspec.c:Bool wNETWMCheckClientHintChange(WWindow * wwin, XPropertyEvent * event)
wmspec.h:Bool wNETWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event);
The function wNETWMCheckClientHints returns a Boolean, but
this value is never used, so can be removed.
This patch removes the boolean returned, the variable hasState,
and so some parts of the function changes.
The patch also moves some variable definition to the same line:
one type, one line.
The function wNETWMCheckInitialClientState returns a Bool,
but this value is never used, so the function can be void.
kix@osaka:~/src/wmaker/wmaker-crm-tosnd/src$ grep wNETWMCheckInitialClientState *.[ch]
window.c: wNETWMCheckInitialClientState(wwin);
wmspec.c:Bool wNETWMCheckInitialClientState(WWindow * wwin)
wmspec.c: wmessage("wNETWMCheckInitialClientState");
wmspec.h:Bool wNETWMCheckInitialClientState(WWindow *wwin);
kix@osaka:~/src/wmaker/wmaker-crm-tosnd/src$
The wmessage function returns "enter" in two functions, so is
not possible to know the function that sends the message.
It is better to replace it with the function name.
After we exit there are no window decorations therefore frame extents
are meaningless.
We could be left with parts of the window being the wrong opacity if the
property is left intact and a compositing manager configured to draw
decorations with a different opacity to the rest of the window is still
running.
Remove the _NET_FRAME_EXTENTS property from all windows when we shut
down to prevent windows from being drawn incorrectly after we're gone.
Recalculate frame extents when the titlebar, resize bar or border are
enabled/disabled.
Account for border when calculating top and bottom frame extents.
Quoth I,
> I've just seen that _NET_FRAME_EXTENTS isn't updated when
> disabling or enabling the titlebar, resizebar and border of a window,
> so that needs to be fixed.
The attached patch fixes _NET_FRAME_EXTENTS not updating when using
the inspector to disable or enable the titlebar, resizebar or border.
It also fixes not taking the border width into account when
calculating the top and bottom extents.
With the patch the window's border is drawn for 32bpp urxvt windows
with compton. The border still isn't black, however. That's because
the border is taken from the screen's colormap rather than the
window's. I'll have a fix for that soon.
The icon size should be set when the icon is created. Therefore the icon size
for net_icon_image should be set at get_wwindow_image_from_x11(), function that
creates the image.
This patch adds support for the _NET_FRAME_EXTENTS property as
described in the EWMH spec. With it I was able to use the compton
compositing manager to draw fully opaque windows with semi-transparent
titlebars and resizebars.
Set the _NET_FRAME_EXTENTS property based on border widths and
titlebar/resizebar heights.
The EWMH spec says:
"_NET_FRAME_EXTENTS, left, right, top, bottom, CARDINAL[4]/32
The Window Manager MUST set _NET_FRAME_EXTENTS to the extents of the
window's frame. left, right, top and bottom are widths of the
respective borders added by the Window Manager."
Even though net_state_from_client was never being set, it was
being tested inside a
if (!wwin->flags.net_state_from_client)
which according to testing was always being true (probably because gcc
initializes it to zero). But this situation is confusing, so it's
better to remove the if() test altogether as that is the intention
if net_state_from_client is not explicitly set (which it isn't in
the current wmaker source).
This situation is analogous to:
[mafra@Pilar:c]$ cat init.c
int main(void)
{
int a;
if (!a)
printf("No a = %d\n", a);
return 0;
}
[mafra@Pilar:c]$ ./init
No a = 0
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).
On my PowerPC Debian Squeeze System, the icons are colored
incorrectly. This patch removes the swapping of the data on Big Endian
systems, thus causing the icons to be colored correctly.
The data appears to already be in the native endian format.
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").
With Xinerama, on heads other than the primary, certain parts (menus,
scrollbars) of certain types of clients (Qt) are incorrectly or not at
all drawn.
The fix follows other window managers in completely ignoring the
_NET_WORKAREA property.
Problem originally poked at by Ambrus Szabo, correct keyword and the
eventually implemented solution suggested by Lucius Windschuh, typed
up by me.
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>
NET_WM_ICON is a property change, not a message.
updateIconImage doesn't use scr, remove it.
updateIconImage should clear out the net_icon_image if there isn't one
anymore (i.e. XGetWindowProperty fails or the icon cannot be extracted).
When the icon is changed, we need to call wIconUpdate.
Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
Even the option to enable "virtual desktop" in configure.ac was
commented out...and I would never intend to use it anyway.
So let's just remove the ~800 lines of #ifdef'ed code to have a
cleaner code base to read when bored.
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.
New windows should only be focused if they are in the current workspace.
Not performing this check can lead to WM switching workspaces if a
window is opened which:
(a) is configured to appear in a particular workspace
and
(b) sends a _NET_ACTIVE_WINDOW message to give focus to
something, e.g. a sub window.
This behaviour was observed with firefox if a session with more
than one tab open was restored at startup because:
"If a Client wants to activate another window, it MUST send a
_NET_ACTIVE_WINDOW client message to the root window:"
Original-post: http://lists.windowmaker.info/dev/msg00442.html
[crmafra: Added comment]