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

67 Commits

Author SHA1 Message Date
Brad Jorsch
6d5ffca076 Set no_focusable for "notification" and "tooltip" windows
Notification popups, and tooltips for that matter, shouldn't be taking
focus away from apps the user is actually interacting with.
2014-04-24 09:27:15 +01:00
Brad Jorsch
288943c813 Add _NET_WM_WINDOW_TYPEs added in EWMH 1.3
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.
2014-02-13 08:55:47 +00:00
Brad Jorsch
2e0d2f3df9 Minimal support for _NET_WM_WINDOW_OPACITY
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.
2014-02-13 08:55:47 +00:00
Christophe CURIS
be022d9623 wmaker: Use the macro 'wlengthof' to get the number of element in an array
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>
2013-12-30 18:11:03 +00:00
Amadeusz Sławiński
a504370f3b Remove WMFullscreenLevel
Make fullscreen windows be on the same level as normal ones.
2013-12-30 18:11:02 +00:00
Christophe CURIS
1f24970160 wmaker: Removed unused args to local functions in wmspec
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:11 -02:00
Christophe CURIS
fd10d4069f wmaker: Marked args as unused for compiler in WINGs Notif callback code
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>
2013-10-13 23:00:19 +01:00
Rodolfo García Peñas (kix)
f0c5073600 Array of workspaces moved to the workspace object in the global namespace
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.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
c610b8d7ce Variable current_workspace moved to workspace object in global namespace
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.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
9e103a46e9 Variable workspace_count moved to the workspace object in the global namespace
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.
2013-10-09 13:02:44 +01:00
Christophe CURIS
ecfb2dc902 wmaker: Moved definition of WM-related XAtoms into the global variables structure 2013-09-30 00:53:10 +02:00
Christophe CURIS
af6c4ec37f wmaker: Moved timestamp variable (#1) to the global variable structure 2013-09-29 16:31:49 +01:00
Christophe CURIS
74cd836e48 wmaker: Replaced local 'extern' definition of wPreferences by proper header usage
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-30 15:10:09 +01:00
Christophe CURIS
7f6699ffca Changed formula for getting the number of elements in a static array
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
2013-05-11 00:17:27 +01:00
Rodolfo García Peñas (kix)
6aa43d356c wIconChangeTitle rewritten
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.
2013-04-09 08:30:54 +01:00
Rodolfo García Peñas (kix)
4093d24625 wIconUpdate removed image argument
The argument image is not used in any call, so can be removed.
2013-04-08 22:06:26 +01:00
Iain Patterson
2affd6d484 Make window border size configurable.
Use the new preference FrameBorderWidth to configure the width of frame
window borders.
2013-03-26 23:19:39 +00:00
Rodolfo García Peñas (kix)
522d84b0ef wIconUpdate image preselected
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.
2012-11-17 20:38:36 +01:00
Rodolfo García Peñas (kix)
cc1503a2f0 wAppIconPaint argument removed
This patch removes the wAppIconPaint() Bool flag, because now it is
always False.
2012-11-11 11:59:41 +00:00
Rodolfo García Peñas (kix)
33ebded4f9 wAppIconPaint paint argument
The function wAppIconPaint has a new argument. This argument is used
to force an icon create if needed.
2012-11-11 11:57:58 +00:00
Rodolfo García Peñas (kix)
19326554cc Make get_wwindow_image_from_x11() take Window as argument
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.
2012-11-04 00:35:36 +00:00
Iain Patterson
c3024542ad Allow struts from all windows.
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.
2012-10-30 16:22:02 +00:00
Iain Patterson
930e59dd31 Partially support _NET_WM_STRUT_PARTIAL.
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.
2012-10-28 10:58:43 +00:00
Rodolfo García Peñas (kix)
ac4362a88f wmspec code clean - style
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
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
8b6f884d36 wNETWMCheckClientHintChange should be void
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);
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
027a720c17 wNETWMCheckClientHints should be void
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.
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
a6d3317a9a wNETWMCheckInitialClientState is now void
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$
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
235114993d wNETWMShowingDesktop is now static
The function wNETWMShowingDesktop is only used at wmspec.c, so
can be static.
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
404e4a7a03 Make debug statement print function name
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.
2012-10-28 10:58:42 +00:00
Iain Patterson
5c0b851cc6 Remove _NET_FRAME_EXTENTS on shutdown.
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.
2012-09-16 13:01:23 +02:00
Iain Patterson
9ab2b642a6 _NET_FRAME_EXTENTS fixes.
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.
2012-08-24 22:05:44 +01:00
Rodolfo García Peñas (kix)
448a68c6d2 get_wwindow_image_from_x11 icon resize
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.
2012-07-16 02:06:36 +02:00
Iain Patterson
347d6f9fda Support _NET_FRAME_EXTENTS.
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."
2012-07-04 20:38:51 +02:00
Rodolfo García Peñas (kix)
a13eb4e920 Remove never-set variable net_state_from_client
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
2012-06-26 10:38:53 +01:00
Rodolfo García Peñas (kix)
6cbdebb84b WindowMaker: New get_wwindow_image_from_x11 function
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).
2012-03-08 23:31:32 +01:00
Rodolfo García Peñas (kix)
f550333474 Coding style cleanup in wmspec.c
This commit cleans the source a bit and adds some comments.
2012-03-08 23:18:55 +01:00
GhostlyDeath
3c2b3792a6 Remove endian swap for icon image data.
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.
2012-01-18 12:04:57 +00:00
Tamas TEVESZ
f6fefbd9b6 Partial fix for focus stealing
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").
2011-04-18 13:23:22 -07:00
Tamas TEVESZ
af857e8b95 Fix app behaviour on Xinerama displays
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.
2011-04-10 22:10:13 -07:00
Haroldo Santos
c82138eab9 switchpanel: Add skip_switchpanel advanced option
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>
2011-02-17 19:29:15 +01:00
Brad Jorsch
125cba8f82 Paint app icons when updated
Add calls to wAppIconPaint when wIconUpdate is called on the app icon.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-08 22:03:31 +02:00
Brad Jorsch
7aff3b6e44 Fix handling of NET_WM_ICON
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>
2010-10-08 22:00:23 +02:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Carlos R. Mafra
4041278f48 Address some sparse warnings
Plain integer as NULL pointer, non-ANSI function declaration etc.
2010-04-14 18:39:17 +02:00
Carlos R. Mafra
72dfe4aa89 Remove VIRTUAL_DESKTOP code
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.
2010-01-09 13:48:06 +01:00
Carlos R. Mafra
15e37ff942 Remove #ifdef NETWM_HINTS constructs
NETWM_HINT is always defined in src/wconfig.h.in, so
let's remove it from there too.
2009-10-12 01:00:19 +02:00
Carlos R. Mafra
6d75291e1d Add config option to supress focus requests across workspaces
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.
2009-08-26 17:53:08 +02:00
Martin Dietze
a9aeefbe70 Fix NULL pointer dereference
Some weird applications like Safari for Windows running on CXOffice
or some applications running on Wine were causing wmaker to crash.
So let's not rely on a window's `frame' property to be not NULL in
src/wmspec.c.

Original-post: http://lists.windowmaker.info/dev/msg00161.html
See-also: http://lists.windowmaker.info/dev/msg00222.html
2009-08-25 01:10:00 +02:00
Martin Dietze
d6c134f420 Do not switch workspace to follow new windows in others
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]
2009-08-25 00:47:37 +02:00
Vladimir Nadvornik
e113ec10c9 Fix findBestIcon()
This patch fixes the issue described here:

https://bugzilla.novell.com/show_bug.cgi?id=371974
2009-08-21 01:54:26 +02:00