Added MoveToWorkspace*Key, MoveToNextWorkspaceKey,
MoveToPrevWorkspaceKey, MoveToLastWorkspaceKey,
MoveToNextWorkspaceLayerKey and MoveToPrevWorkspaceLayerKey to the
keyboard shortcut panel of WPrefs.
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.
A number of functions relating to the Workspaces menu assume that the
menu contains at least three entries: New, Destroy Last and Workspace1.
Because it is assumed that index 1 contains the Destroy Last entry and
index 2 contains the first workspace entry there are several occurrences
throughout workspace.c of magic numbers relating to those indices.
Replace the magic numbers with some #defines, making the code more
readable and allowing the menu to be expanded later.
The function getShortcutString() was defined statically in winmenu.c.
Replace it with the new function GetShortcutKey() which calls the
existing function GetShortcutString() so it can be used elsewhere and
cut down on code duplication.
A result of this change is that shortcuts are now labelled consistently.
Previously the format was different in generated menus, which used, for
example, M1 to refer to Mod1 whereas window menus used the full string
Mod1. Now both use the shorter form.
One could argue that the new function name is more consistent, as now
GetShortcutString() takes a char * argument and GetShortcutKey() takes a
WShortcutKey argument. That argument assumes that the original
intention behind the name of GetShortcutString() was not to hint that it
returns a String...
This code was used to create the window where the workspace name was showed
to the user. The code now use the standar balloon system, therefore this code
is not used anymore and can be removed.
Other toggle menu items such as Maximize and Shade change their text
labels according to the action which will be performed. A shaded window
has its Shade menu item text changed to Unshade, for instance.
As well as maintaining consistency with other menu items, changing the
Select menu entry's text to Deselect for current selected windows
provides another (the only) way of reporting that a window is selected
when its border has been disabled. Currently the only indication that a
window is selected is that its border colour will change.
Use the new preferences FrameBorderColor and FrameSelectedBorderColor to
set the border colour of frame windows and selected frame windows
respectively.
The function XClearWindow() is called twice, we can remove one.
See the asterisks (**):
Before the call to wIconPaint():
-----------------8<--------------------------
+++ b/src/icon.c
@@ -621,7 +621,6 @@ void update_icon_pixmap(WIcon *icon)
XSetWindowBackgroundPixmap(dpy, icon->core->window, icon->pixmap);
/* Paint it */
** XClearWindow(dpy, icon->core->window);
wIconPaint(icon);
}
-----------------8<--------------------------
First call in wIconPaint() function:
-----------------8<--------------------------
void wIconPaint(WIcon *icon)
{
WScreen *scr = icon->core->screen_ptr;
int x, l, w;
char *tmp;
** XClearWindow(dpy, icon->core->window);
-----------------8<--------------------------
The function wCoreCreateTopLevel() is used in two files (icon.c and
framewin.c), but after create the window, some attributes are changed.
This patch moves the change inside the wCoreCreateTopLevel(), avoiding to
call XChangeWindowAttributes() after the window creation. Now the window
is created in only one step, with all the final attributes.
Some details:
- The function wCoreCreateTopLevel() has now one argument more, the
border pixel color. This attribute was used always as the screen
frame_border_pixel, but in icon.c the attribute is changed to
white_pixel. Now the function wCoreCreateTopLevel() receives the
value frame_border_pixel in framewin.c and scr->white_pixel in
icon.c, as argument.
- The vmask and attribs variables and the call to XChangeWindowAttributes()
are removed in framewin.c and icon.c. The values CWSaveUnder for vmask and
attribs.save_under = True are used if wPreferences.use_saveunders is True.
- CWBorderPixel is not needed in icon.c, because was previously set in wcore.c!
The dock types NORMAL_DOCK and EXTENDED_DOCK are never used
so can be removed.
kix@debian:~/src/wmaker/git/wmaker-crm-base$ rgrep NORMAL_DOCK *
src/dock.h:#define NORMAL_DOCK WM_DOCK
kix@debian:~/src/wmaker/git/wmaker-crm-base$ rgrep EXTENDED_DOCK *
src/dock.h:#define EXTENDED_DOCK WM_CLIP
kix@debian:~/src/wmaker/git/wmaker-crm-base$
The function wSessionRestoreState() calls execCommand()
with the argument "host", but this argument is never used,
so we can remove the argument and the code to make that
argument, dead code at wSessionRestoreState.
From 35f19d77874d1b50de5505b6b1cb31531e1c055a Mon Sep 17 00:00:00 2001
From: Andreas Bierfert <andreas.bierfert@lowlatency.de>
Date: Thu, 31 Jan 2013 22:35:42 +0100
Subject: [PATCH 3/3] Teach WPrefs about OPEN_PLMENU
Add option to WPrefs to read, add and edit OPEN_PLMENU menu entries
This patch adds the OPEN_PLMENU options which behaves similar to OPEN_MENU but
can be used to parse command generated proplists. This can be used e.g. in
conjunction with wmmenugen like:
(
"Generated PL Submenu",
OPEN_PLMENU,
"|| find /usr/share/applications -type f -name '*desktop' | xargs
wmmenugen -parser:xdg"
)
v2: code cleanup
This functions reads a proplist from a pipe instead of a file (like
WMReadPropListFromFile does). It uses a call to popen to open the desired
command, reads data into a buffer till EOF and passes the data to getPropList
for parsing.
v2: code cleanup
There can be these 4 situations:
1. ignore flag + file set
2. no ignore flag + file set
3. ignore flag + no file set
4. no ignore flag + no file set
If the "ignore client supplied icon flag" is not set it means the user wants to use the client-provided icon,
so the eventual file name which might be in the entry field is ignored.
If the user sets the ignore flag and sets the icon name all is fine and Option 1 is done.
If the user tries to set an icon (ignore flag is set) but the file textbox is not set we show the
warning:
"Ignore client supplied icon is set, but icon filename textbox is empty. Using client supplied icon"
and use the client-supplied icon instead.
This patch removes all the appicon stuff from the application creation
to the appicon creation. Now, the application only calls one function
(create_appicon_for_application()) and this function do all the work.
The function do the same code than the code before this patch, but the
only change is that the "if" test to check if the appicon was found in
the docks now is negated, removing the return and doing the appicon_save
inside the function.
Finally, the old makeAppIconFor is now create_appicon_for_application().
The new function set_icon_image_from_database() removes the dup code
from these functions:
icon.c:icon_create_for_dock()
icon.c:icon_create_for_wwindow()
appicon.c:removeAppIconFor()
The only different change is that in the functions icon_create_for_dock()
and icon_create_for_wwindow(), the icon->tile_type assignment is done
before set the icon image filename and icon image, but this variable
is not used in these functions (is used in wIconUpdate function) but in both
functions the icon->tile_type assignment is done before wIconUpdate(), like
the code previous to this patch, so there is no problem moving icon->tile_type.
This patch sets the correct icon after kill a docked application.
To reproduce the problem (as Carlos reported to me), follow these
steps:
1. With a docked application, not running, set the icon image.
2. Launch the docked application.
3. Kill the application, using for example the app dock menu.
The icon is lost. But if wmaker is restarted, the icon backs again.
The problem is because when the application is closed, the function
removeAppIconFor() calls wIconUpdate(), but this function doesn't
find the icon in the file system again. The icon is loaded from the
filesystem only when the application is created.
This patch creates the icon image again, then calls wIconUpdate() to
set the icon image or the default icon image if the icon image was
not found, then wPaint it.
These lines comes from the create_appicon_from_* functions, used
to set the icon image for docks and applications. Are copy/pasted.
When the "Center" choice for window position is chosen, really enforce
the center position for all windows, instead of falling back to "Auto"
when there are already windows on the workspace.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
The new function W_setconf_doubleClickDelay() sets the value for
WPreferences.W_setconf_doubleClickDelay(), therefore the private
data of WPreferences struct is not used.
This call is used at defaults.c to set the doubleClickDelay().
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.
These new functions:
unsigned W_getconf_mouseWheelUp(void);
unsigned W_getconf_mouseWheelDown(void);
returns the WINGs configuration for the Mouse Wheel Up and Down
values.
The new shutdown.h file includes the shutdown modes and the functions
to shutdown Window Maker.
The function definitios were moved from funcs.h and the struct WShutdownMode
from WindowMaker.h.
Now, externs are not needed, only include shutdown.h
This patch moves the XRANDR variable definitions to screen.h, because
xrandr is related to screen behavior. Then, the definition externs
can be removed.
This patch also changes (in event.c) the ConfigureNotify event processing
to avoid call the "if" block if XRANDR is not enabled. I chose the option of
move the if into the HAVE_XRANDR block instead of include the
ConfigureNotify case inside of the HAVE_XRANDR block (proposed by
BALATON Zoltan) to avoid call the default option if not needed.
Resizing windows with the mouse wheel was introduced in a063338175
("Mod+Wheel Window Resize") and it should be disabled by default
in order to not confuse users.
Users wanting this behavior can enable it through WPrefs.
Bug report: https://bugs.launchpad.net/ubuntu/+source/wmaker/+bug/1082879
These are the final changes for the new version 0.95.4. The main change
is set right the symbols for the new version, that include:
- Changes in debian/libwutil2.symbols from the git version to 0.95.4
- Changes in debian/changelog about the comments for the new version
On the other hand, the new debug schema is using hashes, therefore
the /usr/lib/debug/wmaker folder not longer exists. The new folder
is /usr/lib/debug/.build-id. This folder is auto-created and then
we don't need create it in debian/wmaker-dbg.dirs. Therefore, the file
debian/wmaker-dbg.dirs is empty and can be removed.
Finally, a little comment about folder in debian/README.Debian.
This code was commented out but enabling it leads to no issues AFAICS
and improves the usability of WINGs applications.
The motivation for this patch comes from the need of distinguishing
where the cursor is in the WINGs-based application which handles the
database of my comics collection.
This changes the behavior in all parts of wmaker where there is
a text field entry, e.g. in the settings panel of dockapps. There should
be no issues with a blinking cursor in such cases though...
For a icon, the icon image is stored in icon->file_image. If we repaint
the image, we we don't need search the icon again. We can continue using
icon->file_image.
Indeed, if launch the "window inspector" window (winspector), using a
saved icon and "ignore client icon" set, then the database holds the
name of the icon to draw on the screen. If we remove the icon info in
the winspector (removing the file name or un-setting the "ignore client
icon" flag, then the database losts the icon name and then the function
wDefaultUpdateIcons() cannot find the icon to draw for the icon.
In winspector, with this patch, the previous image set by "ApplySettings"
and stored at icon->file_image is used.