1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-11 00:44:12 +01:00

Added ability to set omnipresent icons in Clip.

This commit is contained in:
dan
1999-05-14 23:49:07 +00:00
parent 39513b9f35
commit 70a363de7b
25 changed files with 640 additions and 463 deletions

View File

@@ -1,10 +1,10 @@
/* appicon.c- icon for applications (not mini-window)
*
* Window Maker window manager
*
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
* Copyright (c) 1998 Dan Pascu
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
@@ -45,7 +45,7 @@
#include "dialog.h"
#include "client.h"
/*
/*
* icon_file for the dock is got from the preferences file by
* using the classname/instancename
*/
@@ -83,7 +83,7 @@ wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
scr->app_icon_list = dicon;
if (command) {
dicon->command = wstrdup(command);
dicon->command = wstrdup(command);
}
if (wm_class)
dicon->wm_class = wstrdup(wm_class);
@@ -96,7 +96,7 @@ wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
path = wDefaultGetIconFile(scr, wm_instance, wm_class, False);
}
if (path)
path = FindImage(wPreferences.icon_path, path);
@@ -180,7 +180,7 @@ wAppIconCreate(WWindow *leader_win)
(strcmp(leader_win->wm_instance, tinstance) == 0))
{
/* We have a winner */
wrelease(aicon);
wrelease(aicon);
atmp->num_apps++;
applist->next = atmp->applist;
if (atmp->applist)
@@ -308,7 +308,7 @@ drawCorner(WIcon *icon, WWindow *wwin, int active)
#endif /* NEWAPPICON */
void
void
wAppIconMove(WAppIcon *aicon, int x, int y)
{
XMoveWindow(dpy, aicon->icon->core->window, x, y);
@@ -331,13 +331,13 @@ updateDockNumbers(WScreen *scr)
my_gc_values.foreground = scr->white_pixel;
numbers_gc = XCreateGC(dpy, dicon->icon->core->window,
my_v_mask, &my_gc_values);
ws_numbers = malloc(20);
sprintf(ws_numbers, "%i [ %i ]", scr->current_workspace+1,
sprintf(ws_numbers, "%i [ %i ]", scr->current_workspace+1,
((scr->current_workspace/10)+1));
length = strlen(ws_numbers);
XClearArea(dpy, dicon->icon->core->window, 2, 2, 50,
XClearArea(dpy, dicon->icon->core->window, 2, 2, 50,
scr->icon_title_font->y+1, False);
#ifndef I18N_MB
@@ -381,7 +381,7 @@ wAppIconPaint(WAppIcon *aicon)
&& aicon->command!=NULL) {
XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask);
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
XCopyArea(dpy, scr->dock_dots->image, aicon->icon->core->window,
XCopyArea(dpy, scr->dock_dots->image, aicon->icon->core->window,
scr->copy_gc, 0, 0, scr->dock_dots->width,
scr->dock_dots->height, 0, 0);
}
@@ -390,16 +390,14 @@ wAppIconPaint(WAppIcon *aicon)
{
WApplication *wapp;
wapp = wApplicationOf(aicon->main_window);
if (wapp) {
if (wapp->flags.hidden) {
XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask);
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
XCopyArea(dpy, scr->dock_dots->image,
aicon->icon->core->window,
scr->copy_gc, 0, 0, 7,
scr->dock_dots->height, 0, 0);
}
}
if (wapp && wapp->flags.hidden) {
XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask);
XSetClipOrigin(dpy, scr->copy_gc, 0, 0);
XCopyArea(dpy, scr->dock_dots->image,
aicon->icon->core->window,
scr->copy_gc, 0, 0, 7,
scr->dock_dots->height, 0, 0);
}
}
#endif /* HIDDENDOT */
@@ -429,7 +427,7 @@ wAppIconPaint(WAppIcon *aicon)
XSetClipMask(dpy, scr->copy_gc, None);
if (aicon->launching) {
XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc,
XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc,
0, 0, wPreferences.icon_size, wPreferences.icon_size);
}
}
@@ -440,23 +438,23 @@ wAppIconPaint(WAppIcon *aicon)
#ifdef REDUCE_APPICONS
unsigned int
wAppIconReduceAppCount(WApplication *wapp)
wAppIconReduceAppCount(WApplication *wapp)
{
WAppIconAppList *applist;
if (wapp == NULL)
return 0;
if (wapp->app_icon == NULL)
if (wapp->app_icon == NULL)
return 0;
/* If given a main window, check the applist
* and remove the if it exists
/* If given a main window, check the applist
* and remove the if it exists
*/
applist = wapp->app_icon->applist;
while (applist != NULL) {
if (applist->wapp == wapp) {
/* If this app owns the appicon, change the appicon's
/* If this app owns the appicon, change the appicon's
* owner to the next app in the list or NULL
*/
if (wapp->app_icon->icon->owner == applist->wapp->main_window_desc)
@@ -496,7 +494,7 @@ static void
hideCallback(WMenu *menu, WMenuEntry *entry)
{
WApplication *wapp = (WApplication*)entry->clientdata;
if (wapp->flags.hidden) {
wWorkspaceChange(menu->menu->screen_ptr, wapp->last_workspace);
wUnhideApplication(wapp, False, False);
@@ -510,7 +508,7 @@ static void
unhideHereCallback(WMenu *menu, WMenuEntry *entry)
{
WApplication *wapp = (WApplication*)entry->clientdata;
wUnhideApplication(wapp, False, True);
}
@@ -529,11 +527,11 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
return;
icon->editing = 1;
scr = icon->icon->core->screen_ptr;
wretain(icon);
result = wIconChooserDialog(scr, &file, icon->wm_instance, icon->wm_class);
if (result && !icon->destroyed) {
if (file[0]==0) {
free(file);
@@ -541,7 +539,7 @@ setIconCallback(WMenu *menu, WMenuEntry *entry)
}
if (!wIconChangeImageFile(icon->icon, file)) {
wMessageDialog(scr, _("Error"),
_("Could not open specified icon file"),
_("Could not open specified icon file"),
_("OK"), NULL, NULL);
} else {
wDefaultChangeIcon(scr, icon->wm_instance, icon->wm_class, file);
@@ -565,7 +563,7 @@ killCallback(WMenu *menu, WMenuEntry *entry)
return;
WCHANGE_STATE(WSTATE_MODAL);
assert(entry->clientdata!=NULL);
buffer = wstrappend(wapp->app_icon ? wapp->app_icon->wm_class : NULL,
@@ -592,7 +590,7 @@ static WMenu*
createApplicationMenu(WScreen *scr)
{
WMenu *menu;
menu = wMenuCreate(scr, NULL, False);
wMenuAddCallback(menu, _("Unhide Here"), unhideHereCallback, NULL);
wMenuAddCallback(menu, _("Hide"), hideCallback, NULL);
@@ -609,7 +607,7 @@ openApplicationMenu(WApplication *wapp, int x, int y)
WMenu *menu;
WScreen *scr = wapp->main_window_desc->screen_ptr;
int i;
if (!scr->icon_menu) {
scr->icon_menu = createApplicationMenu(scr);
free(scr->icon_menu->entries[1]->text);
@@ -642,7 +640,7 @@ openApplicationMenu(WApplication *wapp, int x, int y)
/******************************************************************/
static void
static void
iconExpose(WObjDescriptor *desc, XEvent *event)
{
wAppIconPaint(desc->parent);
@@ -664,7 +662,7 @@ iconDblClick(WObjDescriptor *desc, XEvent *event)
fprintf(stderr, "Double-click disabled: missing main window.\n");
return;
}
#endif
#endif
wapp = wApplicationOf(aicon->icon->owner->main_window);
#ifdef DEBUG0
@@ -694,7 +692,7 @@ iconDblClick(WObjDescriptor *desc, XEvent *event)
}
void
void
appIconMouseDown(WObjDescriptor *desc, XEvent *event)
{
WAppIcon *aicon = desc->parent;
@@ -711,10 +709,11 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
int ix, iy;
int clickButton = event->xbutton.button;
Pixmap ghost = None;
Window wins[2];
if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
return;
if (IsDoubleClick(scr, event)) {
iconDblClick(desc, event);
return;
@@ -727,7 +726,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
if (!wapp)
return;
openApplicationMenu(wapp, event->xbutton.x_root,
openApplicationMenu(wapp, event->xbutton.x_root,
event->xbutton.y_root);
/* allow drag select of menu */
@@ -745,7 +744,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
else
wRaiseFrame(icon->core);
if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask
|ButtonReleaseMask|ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime) !=GrabSuccess) {
@@ -757,6 +756,18 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
else
dockable = canBeDocked(icon->owner);
wins[0] = icon->core->window;
wins[1] = scr->dock_shadow;
XRestackWindows(dpy, wins, 2);
if (superfluous) {
if (icon->pixmap!=None)
ghost = MakeGhostIcon(scr, icon->pixmap);
else
ghost = MakeGhostIcon(scr, icon->core->window);
XSetWindowBackgroundPixmap(dpy, scr->dock_shadow,
ghost);
XClearWindow(dpy, scr->dock_shadow);
}
while (!done) {
WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask
@@ -771,7 +782,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
|| abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
XChangeActivePointerGrab(dpy, ButtonMotionMask
|ButtonReleaseMask|ButtonPressMask,
|ButtonReleaseMask|ButtonPressMask,
wCursor[WCUR_MOVE], CurrentTime);
grabbed=1;
} else {
@@ -805,20 +816,6 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
if (!docking) {
Window wins[2];
wins[0] = icon->core->window;
wins[1] = scr->dock_shadow;
XRestackWindows(dpy, wins, 2);
if (superfluous) {
if (icon->pixmap!=None)
ghost = MakeGhostIcon(scr, icon->pixmap);
else
ghost = MakeGhostIcon(scr, icon->core->window);
XSetWindowBackgroundPixmap(dpy, scr->dock_shadow,
ghost);
XClearWindow(dpy, scr->dock_shadow);
}
XMapWindow(dpy, scr->dock_shadow);
}
docking = 1;
@@ -827,7 +824,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
&ix, &iy, False)) {
shad_x = workspace->clip->x_pos + ix*wPreferences.icon_size;
shad_y = workspace->clip->y_pos + iy*wPreferences.icon_size;
if (scr->last_dock != workspace->clip && collapsed) {
scr->last_dock->collapsed = 1;
wDockHideIcons(scr->last_dock);
@@ -845,20 +842,6 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
XMoveWindow(dpy, scr->dock_shadow, shad_x, shad_y);
if (!docking) {
Window wins[2];
wins[0] = icon->core->window;
wins[1] = scr->dock_shadow;
XRestackWindows(dpy, wins, 2);
if (superfluous) {
if (icon->pixmap!=None)
ghost = MakeGhostIcon(scr, icon->pixmap);
else
ghost = MakeGhostIcon(scr, icon->core->window);
XSetWindowBackgroundPixmap(dpy, scr->dock_shadow,
ghost);
XClearWindow(dpy, scr->dock_shadow);
}
XMapWindow(dpy, scr->dock_shadow);
}
docking = 1;
@@ -896,7 +879,7 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
if (!docked) {
/* If icon could not be docked, slide it back to the old
* position */
SlideWindow(icon->core->window, x, y, aicon->x_pos,
SlideWindow(icon->core->window, x, y, aicon->x_pos,
aicon->y_pos);
}
} else {
@@ -927,5 +910,5 @@ appIconMouseDown(WObjDescriptor *desc, XEvent *event)
#ifdef DEBUG
puts("End icon move");
#endif
}

View File

@@ -76,6 +76,7 @@ typedef struct WAppIcon {
unsigned int gnustep_app:1; /* if this is a GNUstep application */
unsigned int docked:1;
unsigned int omnipresent:1; /* If omnipresent when docked in clip */
unsigned int attracted:1; /* If it was attracted by the clip */
unsigned int launching:1;
unsigned int running:1; /* application is already running */

File diff suppressed because it is too large Load Diff

View File

@@ -109,4 +109,10 @@ void wClipUpdateForWorkspaceChange(WScreen *scr, int workspace);
RImage *wClipMakeTile(WScreen *scr, RImage *normalTile);
#define WO_FAILED 0
#define WO_NOT_APPLICABLE 1
#define WO_SUCCESS 2
int wClipMakeIconOmnipresent(WAppIcon *aicon, int omnipresent);
#endif

View File

@@ -1,9 +1,9 @@
/* dockedapp.c- docked application settings panel
*
*
* Window Maker window manager
*
*
* Copyright (c) 1998 Alfredo K. Kojima
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
@@ -48,12 +48,12 @@ extern WPreferences wPreferences;
typedef struct _AppSettingsPanel {
WMWindow *win;
WAppIcon *editedIcon;
WWindow *wwin;
WMLabel *iconLabel;
WMLabel *nameLabel;
WMFrame *commandFrame;
WMTextField *commandField;
@@ -66,6 +66,7 @@ typedef struct _AppSettingsPanel {
WMButton *browseBtn;
WMButton *autoLaunchBtn;
WMButton *omnipresentBtn;
WMButton *okBtn;
WMButton *cancelBtn;
@@ -92,7 +93,7 @@ updateCommand(WAppIcon *icon, char *command)
}
icon->command = command;
if (!icon->wm_class && !icon->wm_instance && icon->command
if (!icon->wm_class && !icon->wm_instance && icon->command
&& strlen(icon->command)>0) {
icon->forced_dock = 1;
}
@@ -118,13 +119,13 @@ static void
updateSettingsPanelIcon(AppSettingsPanel *panel)
{
char *file;
file = WMGetTextFieldText(panel->iconField);
if (!file)
WMSetLabelImage(panel->iconLabel, NULL);
else {
char *path;
path = FindImage(wPreferences.icon_path, file);
if (!path) {
wwarning(_("could not find icon %s, used in a docked application"),
@@ -165,8 +166,8 @@ chooseIconCallback(WMWidget *self, void *clientData)
panel->choosingIcon = 1;
WMSetButtonEnabled(panel->browseBtn, False);
result = wIconChooserDialog(panel->wwin->screen_ptr, &file,
result = wIconChooserDialog(panel->wwin->screen_ptr, &file,
panel->editedIcon->wm_instance,
panel->editedIcon->wm_class);
@@ -177,7 +178,7 @@ chooseIconCallback(WMWidget *self, void *clientData)
free(file);
updateSettingsPanelIcon(panel);
}
WMSetButtonEnabled(panel->browseBtn, True);
} else {
/* kluge for the case, the user asked to close the panel before
@@ -193,8 +194,8 @@ panelBtnCallback(WMWidget *self, void *data)
WMButton *btn = self;
AppSettingsPanel *panel = (AppSettingsPanel*)data;
char *text;
int done;
int done, omnipresent;
done = 1;
if (panel->okBtn == btn) {
text = WMGetTextFieldText(panel->iconField);
@@ -204,10 +205,10 @@ panelBtnCallback(WMWidget *self, void *data)
}
if (!wIconChangeImageFile(panel->editedIcon->icon, text)) {
char *buf;
buf = wmalloc(strlen(text) + 64);
sprintf(buf, _("Could not open specified icon file: %s"), text);
if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf,
if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), buf,
_("OK"), _("Ignore"), NULL) == WAPRDefault) {
if (text)
free(text);
@@ -244,7 +245,19 @@ panelBtnCallback(WMWidget *self, void *data)
updateDNDCommand(panel->editedIcon, text);
#endif
panel->editedIcon->auto_launch =
omnipresent = WMGetButtonSelected(panel->omnipresentBtn);
if (wClipMakeIconOmnipresent(panel->editedIcon, omnipresent) ==
WO_FAILED) {
wMessageDialog(panel->wwin->screen_ptr, _("Error"),
_("Sorry, icon cannot be made omnipresent. "
"Please make sure that no other icon is "
"docked in the same position on the other "
"workspaces, and try again."),
_("OK"), NULL, NULL);
return;
}
panel->editedIcon->auto_launch =
WMGetButtonSelected(panel->autoLaunchBtn);
}
@@ -254,10 +267,10 @@ panelBtnCallback(WMWidget *self, void *data)
#define PWIDTH 295
#define PHEIGHT 345
#define PHEIGHT 375
void
void
ShowDockAppSettingsPanel(WAppIcon *aicon)
{
AppSettingsPanel *panel;
@@ -265,15 +278,15 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
Window parent;
WMFont *font;
int x, y;
panel = wmalloc(sizeof(AppSettingsPanel));
memset(panel, 0, sizeof(AppSettingsPanel));
panel->editedIcon = aicon;
aicon->panel = panel;
aicon->editing = 1;
panel->win = WMCreateWindow(scr->wmscreen, "applicationSettings");
WMResizeWidget(panel->win, PWIDTH, PHEIGHT);
@@ -281,7 +294,7 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
WMResizeWidget(panel->iconLabel, 64, 64);
WMMoveWidget(panel->iconLabel, 10, 10);
WMSetLabelImagePosition(panel->iconLabel, WIPImageOnly);
panel->nameLabel = WMCreateLabel(panel->win);
WMResizeWidget(panel->nameLabel, 190, 18);
WMMoveWidget(panel->nameLabel, 80, 35);
@@ -294,75 +307,84 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
panel->autoLaunchBtn = WMCreateSwitchButton(panel->win);
WMResizeWidget(panel->autoLaunchBtn, PWIDTH-30, 20);
WMMoveWidget(panel->autoLaunchBtn, 15, 80);
WMSetButtonText(panel->autoLaunchBtn,
WMSetButtonText(panel->autoLaunchBtn,
_("Start when WindowMaker is started"));
WMSetButtonSelected(panel->autoLaunchBtn, aicon->auto_launch);
panel->omnipresentBtn = WMCreateSwitchButton(panel->win);
WMResizeWidget(panel->omnipresentBtn, PWIDTH-30, 20);
WMMoveWidget(panel->omnipresentBtn, 15, 102);
WMSetButtonText(panel->omnipresentBtn,
_("Omnipresent application icon"));
WMSetButtonEnabled(panel->omnipresentBtn,
aicon->dock!=scr->dock && aicon!=scr->clip_icon);
WMSetButtonSelected(panel->omnipresentBtn, (aicon->omnipresent ||
aicon->dock==scr->dock || aicon==scr->clip_icon));
panel->commandFrame = WMCreateFrame(panel->win);
WMResizeWidget(panel->commandFrame, 275, 50);
WMMoveWidget(panel->commandFrame, 10, 105);
WMMoveWidget(panel->commandFrame, 10, 130);
WMSetFrameTitle(panel->commandFrame, _("Application path and arguments"));
panel->commandField = WMCreateTextField(panel->commandFrame);
WMResizeWidget(panel->commandField, 256, 20);
WMMoveWidget(panel->commandField, 10, 20);
WMSetTextFieldText(panel->commandField, aicon->command);
panel->dndCommandFrame = WMCreateFrame(panel->win);
WMResizeWidget(panel->dndCommandFrame, 275, 70);
WMMoveWidget(panel->dndCommandFrame, 10, 165);
WMSetFrameTitle(panel->dndCommandFrame,
WMMoveWidget(panel->dndCommandFrame, 10, 190);
WMSetFrameTitle(panel->dndCommandFrame,
_("Command for files dropped with DND"));
panel->dndCommandField = WMCreateTextField(panel->dndCommandFrame);
WMResizeWidget(panel->dndCommandField, 256, 20);
WMMoveWidget(panel->dndCommandField, 10, 20);
panel->dndCommandLabel = WMCreateLabel(panel->dndCommandFrame);
WMResizeWidget(panel->dndCommandLabel, 256, 18);
WMMoveWidget(panel->dndCommandLabel, 10, 45);
#ifdef OFFIX_DND
WMSetTextFieldText(panel->dndCommandField, aicon->dnd_command);
WMSetLabelText(panel->dndCommandLabel,
WMSetLabelText(panel->dndCommandLabel,
_("%d will be replaced with the file name"));
#else
WMSetTextFieldEditable(panel->dndCommandField, False);
WMSetLabelText(panel->dndCommandLabel,
_("DND support was not compiled in"));
_("DND support was not compiled in"));
#endif
panel->iconFrame = WMCreateFrame(panel->win);
WMResizeWidget(panel->iconFrame, 275, 50);
WMMoveWidget(panel->iconFrame, 10, 245);
WMMoveWidget(panel->iconFrame, 10, 270);
WMSetFrameTitle(panel->iconFrame, _("Icon Image"));
panel->iconField = WMCreateTextField(panel->iconFrame);
WMResizeWidget(panel->iconField, 176, 20);
WMMoveWidget(panel->iconField, 10, 20);
WMSetTextFieldText(panel->iconField,
wDefaultGetIconFile(scr, aicon->wm_instance,
WMSetTextFieldText(panel->iconField,
wDefaultGetIconFile(scr, aicon->wm_instance,
aicon->wm_class, True));
panel->browseBtn = WMCreateCommandButton(panel->iconFrame);
WMResizeWidget(panel->browseBtn, 70, 24);
WMMoveWidget(panel->browseBtn, 195, 18);
WMSetButtonText(panel->browseBtn, _("Browse..."));
WMSetButtonAction(panel->browseBtn, chooseIconCallback, panel);
panel->okBtn = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->okBtn, 80, 26);
WMMoveWidget(panel->okBtn, 200, 308);
WMMoveWidget(panel->okBtn, 200, 333);
WMSetButtonText(panel->okBtn, _("OK"));
WMSetButtonAction(panel->okBtn, panelBtnCallback, panel);
panel->cancelBtn = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->cancelBtn, 80, 26);
WMMoveWidget(panel->cancelBtn, 110, 308);
WMMoveWidget(panel->cancelBtn, 110, 333);
WMSetButtonText(panel->cancelBtn, _("Cancel"));
WMSetButtonAction(panel->cancelBtn, panelBtnCallback, panel);
WMRealizeWidget(panel->win);
WMMapSubwidgets(panel->win);
WMMapSubwidgets(panel->commandFrame);
@@ -376,7 +398,7 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
XSelectInput(dpy, parent, KeyPressMask|KeyReleaseMask);
XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);
y = aicon->y_pos;
if (y < 0)
y = 0;
@@ -391,16 +413,16 @@ ShowDockAppSettingsPanel(WAppIcon *aicon)
} else {
x = (scr->scr_width - PWIDTH)/2;
}
panel->wwin = wManageInternalWindow(scr, parent, None,
panel->wwin = wManageInternalWindow(scr, parent, None,
_("Docked Application Settings"),
x, y, PWIDTH, PHEIGHT);
panel->wwin->client_leader = WMWidgetXID(panel->win);
panel->parent = parent;
WMMapWidget(panel->win);
wWindowMap(panel->wwin);
}
@@ -410,23 +432,23 @@ DestroyDockAppSettingsPanel(AppSettingsPanel *panel)
{
if (!panel->destroyed) {
XUnmapWindow(dpy, panel->wwin->client_win);
XReparentWindow(dpy, panel->wwin->client_win,
XReparentWindow(dpy, panel->wwin->client_win,
panel->wwin->screen_ptr->root_win, 0, 0);
wUnmanageWindow(panel->wwin, False, False);
}
panel->destroyed = 1;
/*
* kluge. If we destroy the panel before the icon chooser is closed,
* we will crash when it does close, trying to access something in the
* destroyed panel. Could use wretain()/wrelease() in the panel,
* destroyed panel. Could use wretain()/wrelease() in the panel,
* but it is not working for some reason.
*/
if (panel->choosingIcon)
if (panel->choosingIcon)
return;
WMDestroyWidget(panel->win);
WMDestroyWidget(panel->win);
XDestroyWindow(dpy, panel->parent);

View File

@@ -62,6 +62,11 @@ typedef struct WReservedArea {
#endif
typedef struct WAppIconChain {
struct WAppIcon *aicon;
struct WAppIconChain *next;
} WAppIconChain;
/*
* each WScreen is saved into a context associated with it's root window
@@ -230,6 +235,7 @@ typedef struct _WScreen {
struct WMenu *clip_options; /* Options for Clip */
struct WMenu *clip_ws_menu; /* workspace menu for clip */
struct WDock *last_dock;
WAppIconChain *global_icons; /* for omnipresent icons chain in clip */
Window clip_balloon; /* window for workspace name */

View File

@@ -869,7 +869,7 @@ wWorkspaceRestoreState(WScreen *scr)
{
proplist_t parr, pstr, wks_state;
proplist_t clip_state;
int i, wscount;
int i, j, wscount;
make_keys();
@@ -899,9 +899,24 @@ wWorkspaceRestoreState(WScreen *scr)
if (scr->workspaces[i]->clip)
wDockDestroy(scr->workspaces[i]->clip);
scr->workspaces[i]->clip = wDockRestoreState(scr, clip_state,
WM_CLIP);
WM_CLIP);
if (i>0)
wDockHideIcons(scr->workspaces[i]->clip);
/* We set the global icons here, because scr->workspaces[i]->clip
* was not valid in wDockRestoreState().
* There we only set icon->omnipresent to know which icons we
* need to set here.
*/
for (j=0; j<scr->workspaces[i]->clip->max_icons; j++) {
WAppIcon *aicon = scr->workspaces[i]->clip->icon_array[j];
if (aicon && aicon->omnipresent) {
aicon->omnipresent = 0;
wClipMakeIconOmnipresent(aicon, True);
XMapWindow(dpy, aicon->icon->core->window);
}
}
}
#ifdef KWM_HINTS
wKWMUpdateWorkspaceNameHint(scr, i);