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

220 Commits

Author SHA1 Message Date
Doug Torrance
b764a766bf Add keyboard shortcut to run application.
A common feature in several desktop environments is the ability to bring up
a "run application" dialog via a keyboard shortcut (frequently Mod1+F2).  This
feature has been available to Window Maker users only through the root menu.

This patch adds the ability for a user to set up a keyboard shortcut to
accomplish this, either via WPrefs or by editing ~/GNUstep/Defaults/WindowMaker,
e.g., with
 RunKey = "Mod1+F2";

Code from the execCommand function in rootmenu.c has been copied almost directly
into the handleKeyPress function in misc.c to accomplish this.
2014-05-10 10:01:51 +01:00
Rodolfo García Peñas (kix)
761f3c6e85 Remove compiler warnings in defaults.c
This patch removes these warnings:

defaults.c: In function ‘getFont’:
defaults.c:2011:84: warning: unused parameter ‘addr’ [-Wunused-parameter]
 static int getFont(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
                                                                                    ^
defaults.c: In function ‘getColor’:
defaults.c:2036:85: warning: unused parameter ‘addr’ [-Wunused-parameter]
 static int getColor(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
2014-02-09 22:53:15 +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
Christophe CURIS
6909ee0976 wmaker: Marked arg as unused for compiler in Timer handler
The timers proposed by WINGs toolkit are handled with a callback function,
which means having a fixed argument list for that application function.

It is then correct to not use the argument, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:10 -02:00
Christophe CURIS
7c02d5f1c5 wmaker: Marked args as unused for compiler in process death handlers
When a sub-process terminate, the function to process that event is
defined using a callback mechanism, which means having a fixed argument
list for that application 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:03:23 +01:00
Christophe CURIS
bd77216edf wmaker: Removed explicit callback type conversion
It is dangerous to use a function that does not use the same prototype as
expected by the callback, because that mean there is conversion performed
for the arguments, on which the compiler has no possibility to report
problems.

It is safer to create the function with the strict argument list, and
insert an  explicit type conversion for which the compiler will be able
to perform compatibility checks, and include optional code when needed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-10-13 23:03:23 +01:00
Christophe CURIS
adb936e9f2 wmaker: Marked args as unused for compiler in callback code
To have an easy-to-maintain code, the configuration loading function is
using a lot off callbacks, which means having a fixed argument list.

It is then correct to not use all of them in all case, 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
Christophe CURIS
f3e3ddf4f2 Removed unused WScreen argument in dock's clip function 2013-10-12 15:18:06 +01:00
Christophe CURIS
18059fb1c7 wmaker: Moved definition of global variable 'wKeyBindings' to header
Multiple declaration of global variables in local source files is
a dangerous idea.
2013-10-11 21:58:14 +01:00
Christophe CURIS
d9832e578f wmaker: Moved global domain definition to the global namespace
The default domains were originally defined in different global
variables in C files; This patches groups them in a single
structure placed in global namespace.
2013-10-11 21:58:14 +01:00
Christophe CURIS
b6423a7b4f wmaker: Moved variable Screen Count into the global namespace 2013-10-10 20:05:26 +01:00
Rodolfo García Peñas (kix)
014bc52531 wClipIconPaint appicon argument removed
Because the wClipIconPaint() function is specific to paint the clip,
it knows where is the clip (wks_info.clip_icon), so the argument is not
needed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
2103fe390b Variable clip_icon moved to clip object in the global namespace
The variable clip_icon, that contains the Clip appicon
is moved to the global clip properties.

Now the screen is not needed to know the clip_icon.
2013-10-09 13:02:45 +01:00
Rodolfo García Peñas (kix)
4a7daf2322 AppIcon list moved out of WScreen
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>
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
074092f319 Removed WScreen args not used
The WScreen arguments in the functions wWorkspaceMenuUpdate() and
makeMakeShortcutMenu() is not used now, so can be removed.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
e86b8dcb2f Clip, Dock and Drawers menu moved to appropriate global namespace
The clip, dock, workspaces and drawers menus are common for all
workspaces, so they should be included in the global namespace
instead of the screen struct.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
9c252988f8 Variable workspace_menu moved to workspace object in global namespace
The variable workspace_menu, that contains the workspace_menu
is moved to the global workspace properties.

Now the screen is not needed to know the workspace_menu.

This variable is moved to the global workspace struct because it is
related to the workspace system, and not to the screen.
2013-10-09 13:02:44 +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)
f60e65001b Moved 'workspace_name_font' from the Screen to a Workspace object in the global namespace
The new workspace struct includes the global information
for the workspaces. All information related with the workspaces
should be included here.

The first variable moved is workspace_name_font, included in this
patch. This variable was included in the screen info, but the
screen and the font used in the workspace name don't have any
relationship.
2013-10-09 13:02:44 +01:00
Rodolfo García Peñas (kix)
4ac65ab260 wmaker: code style
This patch removes some extra curly brackets, some empty lines,
extra spaces, ... to follow wmaker's coding style
2013-10-09 13:02:44 +01:00
Christophe CURIS
b48b3370e2 wmaker: Moved global var with list of cursors to the preferences variable
As the cursor choice for each action is actually a user choice,
it is logical to put this into the structure, instead of a poorly
defined 'extern' in every file.
2013-09-30 00:53:10 +02: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
a6410d61e5 wmaker: Added 'const' attribute to local variables
A number of these variable are not meant to be modified, so we
show this to the compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
f0c1dc9fc3 wmaker: Added 'const' attribute to most local functions
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
69b6848187 wmaker: Added 'const' attribute to function 'wDefaultsInitDomain'
This has a few side effects which are properly handled by this patch

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-16 19:32:23 +01:00
Christophe CURIS
528955c447 Added explicit prototype for callback function and fixed code accordingly
Using an unspecified prototype function for a callback is calling
for problem. Added an explicit prototype for the 2 callback
functions in WDefaultEntry, and fixed the functions used to match
it. The new code should be a lot safer.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-06-09 22:20:57 +01:00
Iain Patterson
a6b1833b41 Preference to open the switchpanel without selecting a window.
If the new preference SwitchPanelOnlyOpen is set to YES, pressing
alt-tab or similar shortcut will only open the panel without
automatically switching to the next window.  Shortcuts will continue to
function normally once the panel is open.

Users can enable the new preference if they find themselves regularly
opening the switchpanel just to visualise which windows are open, or to
initiate same-class cycling.

The default value of the new preference is NO.  Behaviour is unchanged
unless the preference is explicitly enabled with the following command:

  $ wdwrite WindowMaker SwitchPanelOnlyOpen YES
2013-06-07 19:53:10 +01:00
Rodolfo García Peñas (kix)
9ededf6cb2 New header file winmenu.h
The file winmenu.h includes the function prototypes for winmenu.c.

The prototypes included were moved from funcs.h.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
2013-05-26 19:48:00 +01:00
Rodolfo García Peñas (kix)
157209a035 New header file event.h
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>
2013-05-26 19:48:00 +01:00
Renan Traba
3eb01800e8 added new windows positions
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
2013-05-21 11:24:36 +01:00
Renan Traba
d025625df0 added new maximize positions, top and bottom
these new positions are equal to left and right,
but they are at top and bottom half of screen
2013-05-21 11:24:35 +01:00
Christophe CURIS
a622197faa Added explicit 'void' to function that takes no argument
This is the correct way to tell that a function takes no
arguments, because an empty parameter list tells the compiler
that it is not yet defined, and is tolerated only for
compatibility with very old C compilers for whom prototypes
were not yet a defined language element.
2013-05-12 01:01:20 +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
Iain Patterson
90675a6f04 Set StrictWindozeCycle by default.
Window Maker's behaviour changes when StrictWindozeCycle is active.  As
a rule we try not to set the default value of new options such that they
would change the behaviour expected by users.

In this case, however, the switchpanel was not working as intended.
Users who prefer the old method can set StrictWindozeCycle off with

  wdwrite WindowMaker StrictWindozeCycle NO
2013-05-02 20:41:07 +01:00
Iain Patterson
c9937f6f6a Fix StartWindozeCycle() shift key behaviour.
As the name implies, StartWindozeCycle() cycles windows in the same way
that a popular commercially-available operating system does.  However
Window Maker's handling of the shift key in the switchpanel does not
currently mirror that of its commercial counterpart.

In the popular operating system:

  Holding alt and shift then pressing and releasing tab will highlight
  the previous window in the switcher.

  Releasing shift with alt still held will not close the switcher.

  The window change is commited when alt is released.

In Window Maker:

  Holding alt and shift then pressing and releasing tab will highlight
  the previous window in the switchpanel.

  Releasing shift with alt still held will close the switchpanel and commit
  the window change.

This patch adds the StrictWindozeCycle boolean preference.  When it is
set to YES the switchpanel will remain open as long as alt is held even
if shift is pressed and released.
2013-05-02 20:41:07 +01:00
Rodolfo García Peñas (kix)
41da1b30db New file misc.h
This is the new file misc.h, with the function prototypes for misc.c.
This file is created using misc.c and removing the prototypes from funcs.h
2013-04-17 10:13:25 +01:00
Carlos R. Mafra
529ee0bd21 Merge branch 'wmdrawer' into next 2013-04-12 02:14:41 +01:00
Daniel Déchelotte
878a57d7b2 Add option to merge the workspace-switching functionality into the dock
The dock will have the up-right and down-left arrows to change workspaces and
the clip will be disabled. That is, if option ClipMergedInDock is set to yes in
GNUstep/Defaults/WindowMaker.
[not thoroughly tested]
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
36bed6a77e Wrap appicons when dock is moved up and down
Add WrapAppiconsInDock option to control that behaviour (default: YES)
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
e14e6b3da8 Add drawers to wmaker!
Drawers are horizontal docks, and they can themselves only live in the dock

To use them, right click on the dock or a docked appicon and select "Add
a drawer". Then move appicons into the drawer (drag them with the
mouse). You may change the icon of the drawer. By default, drawers
auto-expand and -collapse, and auto-raise/lower. This can be customized
in the same way as for the clip.

Set DisableDrawers to YES in G/D/WindowMaker if you do not want to see
the menu entry to add a drawer.

Just discovered this bug: the auto-attract icon functionality will not
work (to be precise, it crashes WM!) if the clip is disabled
(NoClip=YES). Will fix shortly, of course.
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
d24cbc79ee Make the clip's auto-delays configurable
The options are ClipAutoraiseDelay, ClipAutolowerDelay, ClipAutoexpandDelay, ClipAutocollapseDelay

The default values are weird but merely represent the previously
hard-coded ones. They are repeated in Defaults/WindowMaker to avoid a
WPrefs crash (but it's a good idea to make them "visible", too)

WPrefs change coming up
2013-04-12 02:14:10 +01:00
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
63219247c6 Added shortcut to switch to last used workspace.
Added new LastWorkspaceKey shortcut and Workspaces menu entry to switch back to
the last used workspace.
2013-03-28 18:57:40 +00:00
Iain Patterson
d25fde4173 Show shortcuts for workspace switching menu entries.
When showing a Workspaces menu entry for switching to a particular
workspace, also show the shortcut if one is bound for switching to that
workspace.
2013-03-28 18:53:14 +00:00
Rodolfo García Peñas (kix)
0da2b6e928 Removed old window clip balloon code
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.
2013-03-27 00:24:17 +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)
b9caaa8729 WINGs: New function W_setconf_doubleClickDelay
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().
2013-01-12 14:45:29 +00:00
Carlos R. Mafra
3b8c36510f Set mod+wheel to OFF by default
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
2013-01-06 23:27:44 +00:00