1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 04:48:06 +01:00
Commit Graph

187 Commits

Author SHA1 Message Date
Iain Patterson
ae7235c2df Shortcuts for moving windows between workspaces.
Added new keyboard shortcuts for moving windows between workspaces.

MoveToWorkspace1Key moves the active window directly to workspace 1.
Similarly for MoveToWorkspace2Key through MoveToWorkspace10Key.

MoveToNextWorkspaceKey moves the window to the next workspace,
MoveToPrevWorkspaceKey moves the window to the previous workspace.
Both keys respect the ws_advance and ws_cycle preferences.

MoveToNextWorkspaceLayerKey moves the window ten workspaces "forward" if
possible.
MoveToPrevWorkspaceLayerKey moves the window ten workspaces "back" if
possible.
2013-03-28 19:03:33 +00: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
Iain Patterson
dee30d06ac Make window border colours configurable.
Use the new preferences FrameBorderColor and FrameSelectedBorderColor to
set the border colour of frame windows and selected frame windows
respectively.
2013-03-26 23:19:39 +00:00
Rodolfo García Peñas (kix)
73d75fa848 Don't access to private WINGs info
From the BALATON Zoltan comment:

If the P in WINGsP.h stands for Private then no files outside of WINGs
should include it. If WINGsConfiguration is an internal structure of
WINGs then only accessor methods should be used outside of WINGs.

This patch uses the new functions to read the WINGs configuration, not
using the internal library data.
2013-01-12 14:45:29 +00:00
Carlos R. Mafra
3d47016788 Revert "Maximized windows appear misplaced"
This reverts commit b657f15344.
2012-12-18 18:29:50 +00:00
Carlos R. Mafra
b02a12b8c1 Revert "Prevent windows from drifting on restart."
This reverts commit 3cd382bccc.

Conflicts:
	src/window.c
2012-12-18 18:29:11 +00:00
Carlos R. Mafra
f6f72acbde Revert "Fixed regression when placing windows."
This reverts commit 4e193c172b.

Conflicts:
	src/window.c
2012-12-18 18:20:52 +00:00
Carlos R. Mafra
ff52ef3996 Revert "Prevent border drifting."
This reverts commit df601267e6.

Conflicts:
	src/window.c
2012-12-18 18:18:14 +00:00
Rodolfo García Peñas (kix)
db6605932b window.c clean code 1
This patch only make some code style clean.
2012-11-18 23:40:13 +01:00
BALATON Zoltan
c7e3666e62 Made highlighting the AppIcon of the active app configurable at run time 2012-11-17 20:32:10 +01:00
Iain Patterson
df601267e6 Prevent border drifting.
Windows were drifting by FRAME_BORDER_WIDTH pixels when their
borders were toggled on or off.

Windows which had a border before we managed them were drifting
on shutdown and again at startup.  It happened because the absolute
upper-left co-ordinates of a bordered window would in fact be the
upper-left co-ordinates of the border itself, whereas we consider
the client window to have no border and co-ordinates offset by the
titlebar and frame border.
2012-11-17 11:49:44 +01:00
Iain Patterson
4e193c172b Fixed regression when placing windows.
The initial fix for the bug reported by Paul Seelig whereby windows
would drift on restart introduced two regressions.

New windows would place higher on the screen than intended, possibly
obscuring the bottoms of other windows with their titlebars, and all
windows would jump vertically at shutdown because we weren't restoring
them to where they were before they had a titlebar and border.
2012-11-17 11:49:28 +01:00
Iain Patterson
3cd382bccc Prevent windows from drifting on restart.
Bug report from Paul Seelig:

"Yet another rather strange glitch:

- open three terminal windows
- repeatedly restart wmaker
- all windows slowly drift to the left and up by just a few pixels

If i remember correctly, this is also a longstanding issue and nothing
new. It is no showstopper either, as one rarely restarts wmaker."

The slight drifting left and up seems to have been due to
wWindowConfigure() accounting for the window border when placing, which
was fixed in an earlier commit.

Windows could still shuffle down, however, because wWindowConfigure()
was moving the window down to make room for its window frame.
We now move it up by the titlebar height to cancel out that movement.
2012-11-16 08:06:29 +00:00
Iain Patterson
b657f15344 Maximized windows appear misplaced
Bug report from nikty:

"Window Maker does remember the size of windows, but for maximized windows it does not keep the position.
When a maximized window appears it is shifted to the right for a few pixels (firefox, thunar) or both to the right and to the bottom (openoffice, vlc, virtualbox)."

We weren't accounting for the window border when calculating whether the window would position correctly.

To reproduce:

  * Launch some application which remembers its position.  I used
    Thunar as suggested in the bug report.

  * Maximize!

  * Kill the application.

  * Launch it again.

  * Maximize!  The expected behaviour is that nothing would happen
    because the window should have started right where it was before.
    Observed behaviour is that it moves a few pixels.

After the patch we can verify that the maximize operation is
idempotent with regards to geometry.

Tested with and without Xinerama, with and without a panel strutting
one edge.

Bug report: http://www.kix.es/mantis/view.php?id=4
2012-11-09 23:35:16 +00:00
Iain Patterson
700f8cc706 Brief documentation on wAppIconFor() and wWindowFor().
Brief comment on what wAppIconFor() and wWindowFor() do, as it
may not be immediately obvious.

Given a raw X11 Window they will find the AppIcon (or WWindow,
respectively) associated with that window.  Thus they can map an
X11 object to a Window Maker internal object.
2012-10-30 16:21:44 +00:00
Rodolfo García Peñas (kix)
0bd7bcd434 remove_wwindowstate name changed
The function remove_wwindowstate is now remove_wwindowstate. This was
proposed by Christophe and Carlos:

- - -
On 2012-10-09 01:09, Carlos R. Mafra wrote:
> On Tue,  9 Oct 2012 at  0:58:19 +0200, Christophe wrote:
> you name the function "remove_*", which makes think that it would
> remove the entry from the list, but the function does not do that, it
> just frees the memory, so it may have been better called "free_" (or
> maybe "release_")?
>

Good point, release_ makes more sense to me.
- - -
2012-10-28 10:58:43 +00:00
Rodolfo García Peñas (kix)
e71f78f4fe Code not needed at wWindowSetupInitialAttributes
The variable "check" is always False, so the if (!False) is always
True and the function wNETWMCheckClientHints is always called.

The variable check is not used anymore, so the variable check
can be removed.
2012-10-28 10:58:42 +00:00
Rodolfo García Peñas (kix)
41af9ca07f New helper function remove_wwindowstate()
The common code in the functions wWindowDeleteSavedState and
wWindowDeleteSavedStatesForPID is moved to a new function remove_wwindowstate.
2012-10-06 15:52:29 +01: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
39a5f3da0b Allow windows to specify their own depth.
Accept windows' depth, visual and colormap instead of always using those
of the root window.  Internal windows such as menus behave as before.

In conjunction with a compositing manager on a display supporting the
RENDER extension windows can now manage their own opacity.

I wrote the patch after reading the FAQ for urxvt, which says,
regarding transparency support:

"3. Use an ARGB visual:

  urxvt -depth 32 -fg grey90 -bg rgba:0000/0000/4444/cccc

This requires XFT support, and the support of your X-server. If that
doesn't work for you, blame Xorg and Keith Packard. ARGB visuals
aren't there yet, no matter what they claim. Rxvt-Unicode contains the
necessary bugfixes and workarounds for Xft and Xlib to make it work,
but that doesn't mean that your WM has the required kludges in place."

  In conjunction with a compositing manager (I tested compton) it does
work and urxvt draws a semi-transparent background with fully opaque
foreground text and scrollbars; much prettier than applying a blanket
transparency value over the whole window with the compositing manager.
Other application windows I tested were, as expected, drawn the same
as before.

  I verified that urxvt is drawn in the same way when using xfwm4
(with builtin compositing).  Since Window Maker doesn't (at time of
writing) have its own compositing manager I should clarify that one is
required to see any benefit from this patch.

  Whether or not this feature is useful for any application other than
urxvt I don't know, though I assume that an application which chose an
ARGB visual in the same way would be able to draw itself prettily.

  On a display without RENDER things work just as they do without the
patch.  I have, however, only been able to test on a fairly standard
TrueColor display supporting multiple colour depths with 24bpp being
the default.  Testing with more ... exotic ... display types would
probably be advisable.
2012-08-22 00:24:41 +01:00
Rodolfo García Peñas (kix)
f5d845cfad Remove unused argument from wDefaultFillAttributes()
The function wDefaultFillAttributes() doesn't use the argument WScreen,
so it can be removed.
2012-07-04 20:45:56 +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)
dd94b98b81 Remove unused variable wm_name_changed
wm_name_changed is not used and can be removed.
2012-06-25 23:56:59 +01:00
Rodolfo García Peñas (kix)
c815449e68 Remove unused wWindowCanReceiveFocus()
The function wWindowCanReceiveFocus() is not used, remove it.
2012-06-25 23:53:32 +01:00
Rodolfo García Peñas (kix)
02feb72fdc New colormap header file and remove unused functions
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.
2012-06-25 23:49:10 +01:00
Rodolfo García Peñas (kix)
da4e4128b3 rootmenu header file updated
The contents of the rootmenu.h file are not used and can be removed,
but the prototypes of rootmenu.c are in funcs.h and should be moved
to the correct (rootmenu.h) file.
2012-06-24 12:30:17 +01:00
Rodolfo García Peñas (kix)
6110610f5e Cleanup superfluous.c a bit
The superfluous.[ch] files have a few minor issues, this patch addresses some of them:

- Move the defines to the top of the superfluous.c file
- Include the ifdef NORMAL_ICON_KABOOM inside the DoKaboom() function
  because the DoKaboom is used without the NORMAL_ICON_KABOOM ifdef in
  other files.
- Include the ifdef WINDOW_BIRTH_ZOOM inside the DoWindowBirth() function,
  therefore the function don't needs to be defined twice (with and whitout
  WINDOW_BIRTH_ZOOM define.
- Now the functions are defined in superfluous.h and the externs are not
  needed.
  - We need include the dock.h in the superflous.h because is used by the
    definition of MakeGhostDock().
  - We need include the superfluous.h in window.c (removing the extern)
2012-06-23 11:25:37 +01:00
Tobias Stoeckmann
cc30444dda No need to call memset after wmalloc
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.
2012-05-04 18:41:01 -03:00
Rodolfo García Peñas (kix)
761fd37e51 WindowMaker: Clean curly brackets
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.
2012-04-15 23:15:20 -03:00
Rodolfo García Peñas (kix)
4f4ea569a0 Coding style cleanups 2012-03-04 09:08:52 +00:00
Alexey I. Froloff
e819818eeb Options for limiting window/menu title height
(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>
2012-02-27 14:19:49 +00:00
Tamas TEVESZ
dce16306bc Plug some (possible) memleaks
PropGetWMClass()

- XAllocClassHint()s a struct for class hint data
- This is filled by XGetClassHint(), which in turn uses Xlib to allocate
  some more space for XClassHint members
- Upon XGetClassHint() failure, "default" is libc malloc'd (via strdup),
  and is returned to the caller
- Upon XGetClassHint() success, XClassHint members are returned raw --
  these members must be freed with XFree() (see XAllocClassHint(3))
- Thus it's up to PropGetWMClass() callers to decide (based upon the return
  value) which method (libc free() or XFree()) to use to free res_name
  and res_class. This was done nowhere, thus leaking some memory
  on every failed PropGetWMClass() call.
- So just strdup the successful res_name/res_class members, XFree() them
  while still in PropGetWMClass(), and allow callers to unconditionally
  libc free() whatever PropGetWMClass() returns.
2011-04-18 13:25:44 -07: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
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
Brad Jorsch
b16181143c Fix stuck appicon from embedded apps
When applications are embedded in firefox via mozplugger, e.g. ooffice
for viewing .doc files or xpdf for viewing pdfs, and the embedded
application opens a popup window, we end up with a shared appicon for
the embedded app that remains until Window Maker is restarted.

The underlying cause is that mozplugger winds up reparenting the
embedded app's original leader window to a subwindow of itself, so
wmaker's SubstructureNotifyMask on the root window no longer picks up
the DestroyNotify when that original leader is destroyed.

It seems easy to fix once you track down the problem: when fixing
several other properties in fixLeaderProperties(), add
StructureNotifyMask so we get DestroyNotify no matter where the leader
gets reparented to. A more targeted fix would only add
StructureNotifyMask when the fake group's origLeader is set, but I don't
think a few extra structure notifications are going to cause us any real
problems.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:31 +02:00
Brad Jorsch
3490c8bd30 Minor fixes to appicon highlighting
When an app hides its window but doesn't exit (e.g. apps that "minimize"
to the system tray), the highlighting was not being removed.

When alt-tabbing, the tabbed-to app's icon was not getting highlighted.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:31 +02:00
Brad Jorsch
b305eb84fb Ignore shared_appicon if an appicon already exists
An appicon is created for each group of windows, as specified by the
WM_HINTS window_group or the WM_CLIENT_LEADER. The "shared_appicon"
feature ignores the group leader specified by the application, replacing
it with a dummy leader matching the window's WM_CLASS. This causes
issues for dockapps, since each instance of a dockapp needs its own
appicon to display the different icon_windows, so shared_appicon is
automatically disabled for dockapp windows.

If the application creates some dockapp windows (no shared_appicon) and
some regular windows (with shared_appicon) with the same leader, it can
unexpectedly end up with two different appicons: one for the real group
leader it set and one for the fake leader created for shared_appicons.
Both of these appicons will try to use the same icon_window, which may
cause the dockapp window to suddenly lose its contents as they are moved
to the fake leader's appicon.

There is a simple fix: if a WApplication already exists (and has an
appicon) for the app-specified group leader window, disable
shared_appicon.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-07 12:04:30 +02:00
Tamas TEVESZ
94a0c7b42f Fix some double newlines
Just a couple that woud now print double (or several more) newlines.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Brad Jorsch
8f63bdafcd Periodic bouncing for XUrgencyHint
When a window has XUrgencyHint set, bounce the app icon periodically.
2010-09-17 11:05:51 +02:00
Brad Jorsch
9318a7f428 Improve dockapp recognition
On Wed, Sep 15, 2010 at 04:40:52PM +0200, Gilbert wrote:
>
> "." = {NoAppIcon = Yes;};
>   "*" = {NoAppIcon = Yes;};

Oh, I see. It lets you override NoAppIcon generically instead of for
each app.

> Exactly, having 'DockApp' as the class name makes them behave more
> consistently internally. This might be fixed in some other way
> internally, but I couldn't figure it out...

Except it doesn't, the only thing it changes inside wmaker is that it
avoids displaying the name as "DockApp" on the settings window.

A "dockapp" is just an application that sets icon_window in WM_HINTS
(which causes a window to be displayed as the app icon) and
initial_state to WithdrawnState (which causes the main window to not
actually appear when the window is mapped). The class has nothing to do
with it.

The problems I mentioned stem from gtk+ not allowing you to set
initial_state to WithdrawnState. Openbox and fluxbox (and maybe others)
don't take the icon_window into their "slit" unless initial_state is
WithdrawnState, so the whole thing completely fails. Wmaker always uses
the icon_window for the app icon, so that part works fine, but the
"main" app window still flashes onscreen for a split second before the
app can call gdk_window_withdraw(), and wmaker applies SharedAppIcon to
it which winds up screwing up the "Kill" menu option.

That said, I've attached a patch to have wmaker treat any window with
class DockApp as if it had initial_state = WithdrawnState, and hopefully
openbox, fluxbox, and the like will pick up the idea too so gtk+
hacks[1] will no longer be needed. If this patch is accpeted, I'll poke
fluxbox and openbox to suggest the idea to them.

[1] E.g. http://wmudmount.svn.sourceforge.net/viewvc/wmudmount/dock.c?r1=8&r2=7

Subject: [PATCH] Improve dockapp recognition

Dockapps are traditionally recognized by having initial_state =
WithdrawnState in WM_HINTS. But some toolkits (e.g. gtk+) will not allow
setting initial_state in this way. So we offer an alternative: any
window with the res_class portion of WM_CLASS set as "DockApp" will be
treated as if it had initial_state = WithdrawnState.
2010-09-15 20:36:46 +02:00
Alexey I. Froloff
a257e16593 Bouncing appicon effect
When starting application (or opening transient dialog) bounce
its appicon.

Original-patch-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
2010-09-11 17:53:32 +02:00
Brad Jorsch
68bd644b0d Fix wheel resizing with resize increments
In C, dividing two integers automatically rounds towards zero, so ceil(a
/ b) is useless as the result is truncated before ceil ever sees it. The
correct result for positive integers is obtained by (a + b - 1) / b.
2010-04-26 23:23:56 +02:00
Brad Jorsch
4ddc2a5a0a Don't grab Ctrl+Wheel if ResizeIncrement is 0
I personally cannot stand stealing Ctrl+Wheel for resizing windows, so I
turned it off. But wmaker is still preventing Ctrl+Wheel from reaching
apps, which is certainly not the behavior I desire.
2010-04-26 23:23:56 +02:00
Carlos R. Mafra
0350b8445a Remove unneeded extern's in .c files
They were not being used in those files, so let's remove them.
2010-04-14 18:39:28 +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
Brad Jorsch
37829a7c60 Fix loading saved states on 64-bit systems
One misuse of CARD32 was missed back when someone fixed the 64-bit
issues (background: X has 8-bit, 16-bit, and "32-bit stored in a long"
data formats; on a 64-bit system, long is 64 bits). This was causing
minimized windows to be restored as shaded, and possibly occasional
crashes, when wmaker was restarted.

Also, throw in a safety check that 10 items really were returned before
trying to access them.
2010-04-12 09:58:37 +02:00
Brad Jorsch
65aa3ae9c8 Fix enable-modelock warnings
Fix warnings that only show up when --enable-modelock is passed to
./configure.
2010-04-12 09:58:36 +02:00
Carlos R. Mafra
0c2d2c69b9 Use 'long' instead of 'CARD32' in wClientSetState() and wWindowSaveState()
The rationale is the same as in commit c7f2a189c4
("Fix the call to XChangeProperty() in 64-bit mode"), because we are
calling XChangeProperty() with format 32, which requires the type of
'data' to be 'long'.
2010-03-29 00:17:02 +02:00
Carlos R. Mafra
13ba5d5f5b Remove uncompiled code from src/window.c 2010-03-29 00:17:02 +02:00
Carlos R. Mafra
5178465bb6 Remove DEBUG statements, #if 0 etc
...and some other cleanups.
2010-03-20 18:42:56 +01:00