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

2713 Commits

Author SHA1 Message Date
Daniel Déchelotte
5e004d5f11 Real-time dock left-right swapping
No more ghost dock when switching sides: the real swap happens
immediately, you can still adjust vertically afterwards. Removed two
functions in superfluous that are no longer used
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
cf5fdca63d WPrefs: adds possibility to disable drawers from Docks panel 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
707ce34a5e Added a SlideWindows function to handle horizontally-aligned array of windows
The existing SlideWindow() function is changed to call SlideWindows() with an array of 1 window
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
95a73e2783 Added wDefaultPurgeInfo to remove what we stored about a given instance-class couple.
This function is not used for now, but will be for drawers
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
9fae35fbc4 Merging appicon.c:appIconMouseDown and dock.c:handleIconMove into appicon.c:wHandleAppIconMove
Behaves essentially the same, only a bit more consistently.
Known differences:
1. An AppIcon will now always end up undocked if moved while Mod1 is pressed.
2. Moving a docked AppIcon with Mod1 pressed (undocking it) used to auto-expand the clip,
   as clip expansion happened first, while looking for a snapping position,
   and the test on Mod1 being pressed happened only later
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
8b6ff01d39 Move code that removes icons from a dock to new removeIcons function
Code taken from removeIconsCallback.
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
f93f847b33 Bring back some "About" information when double-clicking the dock
When dock is double-clicked and no application is defined to be launched, show
the information panel (instead of doing nothing).
2013-04-12 02:14:10 +01:00
Daniel Déchelotte
525ab89d01 Increase MAX_WINDOWLIST_WIDTH from 160 to 400 (in pixels) 2013-04-12 02:14:10 +01:00
Daniel Déchelotte
5a6e1653ac WPrefs: new Docks pannel, to change auto-expand/collapse/etc delays 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
Daniel Déchelotte
6f44be87fc Consolidated all code checking whether a tile is fully on screen in one static function
The function existed before, but had all kinds of unneeded arguments and wasn't called everywhere.
2013-04-12 02:14:09 +01:00
Daniel Déchelotte
4b44020488 WPrefs: consolidate the 2 createImages static functions into a global one 2013-04-12 02:14:09 +01:00
Daniel Déchelotte
9548c42b71 Fix leading spaces in comment (trivial) 2013-04-12 02:14:09 +01:00
Daniel Déchelotte
cc02023e3e BF for "some obscured windows briefly appears when switching workspaces"
When changing workspace, mapped windows are unmapped from top to bottom
(referring to their stacking order), causing mapped but obscured windows
to briefly appear when the obscuring window is unmapped and until they
are themselves unmapped. [This might not be visible on recent hardware].
The fix is to unmap windows in reverse stacking order when changing
workspace.
2013-04-12 02:14:09 +01:00
Daniel Déchelotte
be95172c95 Avoid clip flickering when docking an appicon
In handleIconMove, when moving an appicon near the clip, all clips were
systematically shown each time the mouse moved, causing some flickering
(perhaps only perceptible on a low-end machine?). This patch introduces
a showed_all_clips boolean to expand clips only once.
2013-04-12 02:14:09 +01:00
Daniel Déchelotte
dfe7e255b2 Deleted useless test
If btn->omnipresent, then btn->dock is precisely
scr->workspaces[scr->current_workspace]->clip (cf.
wWorkspaceForceChange() calling wClipUpdateForWorkspaceChange())
2013-04-12 02:14:09 +01:00
Christophe CURIS
46c8d6d2bf configure: Add detection of library kvm that is used under OpenBSD
As proposed by Christian Schulte, when compiling WindowMaker on BSD
it uses the kvm library to gather information on processes (in the
os-dependant file), so we must properly link against the corresponding
library, which this patch adds.
2013-04-09 09:03:58 +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)
fa27215fcc wIconPaint: avoid crashing if icon is NULL
This patch checks that the icon exists before painting it.
2013-04-09 08:30:45 +01:00
Rodolfo García Peñas (kix)
8cb744739c Remove wIconUpdate in tileObserver
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed.

Now, the icon pixmap is updated faster.

This change is more difficult to see, this is the explanation:

1. wIconUpdate() updates the icon for the applications, then call
   update_icon_pixmap() to re-create the pixmap.
2. tileObserver() is used if the event WNIconTileSettingsChanged() is
   launched. This event is used in the Notification for docks and wwindows:

WMAddNotificationObserver(tileObserver, icon, WNIconTileSettingsChanged, icon);

3. The function WNIconTileSettingsChanged() is used if the icon need refresh,
   used in the wReadDefaults() function. See code below. This function is used
   in the wmaker startup.

   if (needs_refresh & REFRESH_ICON_TILE)
     WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);

4. Finally, the flag to refresh the icon tile is throw by setIconTile():

   return (reset ? REFRESH_ICON_TILE : 0);

   And this function only changes the the icon tile if reset is "1", that
   happend if src->icon_tile:

        if (scr->icon_tile) {
          reset = 1;
          RReleaseImage(scr->icon_tile);
          XFreePixmap(dpy, scr->icon_tile_pixmap);
        }

5. Then, we can drop the function wIconUpdate(), because the change is in the
   icon_tile variable, used only in icon_update_pixmap(). This function is
   only used in update_icon_pixmap() (not in wIconUpdate):

kix@kentin:~/src/wmaker/git/wmaker-crm/src$ grep icon_tile icon.c
                tile = RCloneImage(scr->icon_tile);
        XSetWindowBackgroundPixmap(dpy, icon->core->window, scr->icon_tile_pixmap);
kix@kentin:~/src/wmaker/git/wmaker-crm/src$

static void icon_update_pixmap(WIcon *icon, RImage *image)
{
[snip]
  if (icon->tile_type == TILE_NORMAL) {
    tile = RCloneImage(scr->icon_tile);
  } else {
    assert(scr->clip_tile);
    tile = RCloneImage(scr->clip_tile);
  }
[snip]

The XSetWindowBackgroundPixmap() call doesn't matter here.
2013-04-08 22:06:27 +01:00
Rodolfo García Peñas (kix)
dee9c457cf Remove wIconUpdate in wDockAttachIcon
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed. This update is only for change
the icon pixmap to un-shadowed.

Now, the icon pixmap is updated faster.
2013-04-08 22:06:27 +01:00
Rodolfo García Peñas (kix)
3d0ed99043 Remove wIconUpdate in wDockDetach
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed. This update is only for change
the icon pixmap to un-shadowed.

Now, the icon pixmap is updated faster.
2013-04-08 22:06:27 +01:00
Rodolfo García Peñas (kix)
88d16d03b9 Remove wIconUpdate in moveIconBetweenDocks
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed. This update is only for change
the icon pixmap to shadowed.

Now, the icon pixmap is updated faster.
2013-04-08 22:06:27 +01:00
Rodolfo García Peñas (kix)
256c8a498e Remove wIconUpdate in keepIconsCallback
The call to wIconUpdate() can be changed by call to update_icon_pixmap(),
because the icon doesn't need to be changed. This update is only for change
the icon pixmap to shadowed.

Now, the icon pixmap is updated faster.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
544bc8e7a7 Move out wIconUpdate from set_icon_image_from_database
The function set_icon_image_from_database() set the icon from the
database, but wIconUpdate() update the icon using different methods
, like for example get the image from X11. So, is better move the
wIconUpdate() to the function who call set_icon_image_from_database(),
to avoid understanding problems.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
883ed8ac9a wIconChangeTitle rewrited
The function wIconChangeTitle() function calls wIconUpdate() or
wIconPaint() depending of changed. In both cases the icon->file_image
doesn't change, only the icon title, so we can use the same image
and we don't need update it. Because the variable changed is removed,
we can use wIconPaint() here.

Then the variable changed is not used, and these lines can be removed.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
ca86f5594d New function update_icon_title
The function update_icon_title() updates the icon title.

The code comes from the function wIconPaint().
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
2c0a449f00 drawIconTitle renamed
The function drawIconTitle() only draw the icon title square, without
the title. The title must be set later, because yet is not initialized,
so is NULL.

Then, the right function name should be drawIconTitleBackground.

This patch also removes the variable titled.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
b3ca57674d Dockapps don't have title
The dockapps don't have title, so this code must be removed.
The title height is 0 then and the variable title_height can
be removed.
2013-04-08 22:06:26 +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
Rodolfo García Peñas (kix)
c24499f6ad wIconChangeImageFile use set_icon_image_from_image
The function wIconChangeImageFile() now use set_icon_image_from_image()
then:

1. Don't need call unset_icon_image() because the memory is free in the
   function set_icon_image_from_image().
2. After update the icon info, it must set the file name.
3. The pixmap image could be updated.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
c088aba057 New function set_icon_image_from_image
The new function set_icon_image_from_image() sets the icon image using
a image provided as argument.

This function will be used to avoid call wIconUpdate() with the image
argument, doing the code easier and faster.

This patch calls unset_icon_image(), to free the icon image, to avoid
lost memory. After this patch, in winspector.c, the wIconUpdate() call
don't free the memory before update it.
2013-04-08 22:06:26 +01:00
Rodolfo García Peñas (kix)
389a0a252c New file placement.h
The file placement.h hold the definitions for placement.c
2013-04-03 19:33:34 +01:00
Rodolfo García Peñas (kix)
6fe23037ef wGetRectForHead moved to where used
The definition and call for wGetRectForHead is moved inside the
if block where is used. This code adds a WScreen pointer to make
the line shorter.

If menu->frame is NULL, then was NULL before this patch, so this
code doesn't include an error about this.

This patch will used with next patch to move the code inside the
block to an specific function.
2013-04-03 19:33:34 +01:00
Rodolfo García Peñas (kix)
b9e8bbbdc7 code clean at startup.c
Small code clean at startup.c
2013-04-03 19:33:34 +01:00
Rodolfo García Peñas (kix)
052efedd93 Removed dup function wScreenSearchForRootWindow
The function wScreenSearchForRootWindow is exactly like wScreenForRootWindow
so can be removed swapping the function call.
2013-04-03 19:20:10 +01:00
Iain Patterson
a401dcbdf6 Document new workspace shortcuts.
Describe the LastWorkspaceKey and MoveToWorkspace*Key shortcuts in the
NEWS file.
2013-03-28 19:09:17 +00:00
Iain Patterson
124442a811 Allow WPrefs to configure workspace switching keys.
Added MoveToWorkspace*Key, MoveToNextWorkspaceKey,
MoveToPrevWorkspaceKey, MoveToLastWorkspaceKey,
MoveToNextWorkspaceLayerKey and MoveToPrevWorkspaceLayerKey to the
keyboard shortcut panel of WPrefs.
2013-03-28 19:04:03 +00: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
cfdf1e92fe Allow WPrefs to configure the last used workspace key.
Added LastWorkspaceKey to the keyboard shortcut panel of WPrefs.
2013-03-28 18:58:23 +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
Iain Patterson
9b27217b53 Eliminate Workspaces menu magic numbers.
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.
2013-03-28 18:50:15 +00:00
Iain Patterson
cd5382cedf Added GetShortcutKey().
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...
2013-03-28 18:47:25 +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
e47413eefd Change Select menu entry text for selected windows.
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.
2013-03-26 23:19:39 +00:00
Iain Patterson
17f1eb6568 Document FrameBorder* preferences.
Describe the new FrameBorderWidth and Frame(Selected)BorderColor
preferences in the NEWS file.
2013-03-26 23:19:39 +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