From 517cd6a8bed6e7dc6210e7f61cf916e43293630d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 2 Apr 2012 17:26:11 +0200 Subject: [PATCH] Remove unused functions These functions are not used: - wDefaultsDestroyDomain - PropWriteGNUstepWMAttr - wSessionSendSaveYourSelf - wXDNDClearAwareness - clearWaitingAckState - wSessionSaveClients --- src/defaults.c | 8 ------ src/defaults.h | 2 -- src/properties.c | 18 -------------- src/properties.h | 1 - src/session.c | 74 -------------------------------------------------------- src/session.h | 10 -------- src/shutdown.c | 3 --- src/xdnd.c | 5 ---- src/xdnd.h | 3 --- 9 files changed, 124 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index dba325aa..793d1d51 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -799,14 +799,6 @@ void wDefaultsMergeGlobalMenus(WDDomain * menuDomain) menuDomain->dictionary = menu; } -void wDefaultsDestroyDomain(WDDomain * domain) -{ - if (domain->dictionary) - WMReleasePropList(domain->dictionary); - wfree(domain->path); - wfree(domain); -} - WDDomain *wDefaultsInitDomain(char *domain, Bool requireDictionary) { WDDomain *db; diff --git a/src/defaults.h b/src/defaults.h index 29d242dc..9174e817 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -37,8 +37,6 @@ WDDomain* wDefaultsInitDomain(char *domain, Bool requireDictionary); void wDefaultsMergeGlobalMenus(WDDomain *menuDomain); -void wDefaultsDestroyDomain(WDDomain *domain); - void wReadDefaults(WScreen *scr, WMPropList *new_dict); void wDefaultUpdateIcons(WScreen *scr); diff --git a/src/properties.c b/src/properties.c index 46bc3caa..0442077d 100644 --- a/src/properties.c +++ b/src/properties.c @@ -244,24 +244,6 @@ Window PropGetClientLeader(Window window) return leader; } -void PropWriteGNUstepWMAttr(Window window, GNUstepWMAttributes * attr) -{ - unsigned long data[9]; - - data[0] = attr->flags; - data[1] = attr->window_style; - data[2] = attr->window_level; - data[3] = 0; /* reserved */ - /* The X protocol says XIDs are 32bit */ - data[4] = attr->miniaturize_pixmap; - data[5] = attr->close_pixmap; - data[6] = attr->miniaturize_mask; - data[7] = attr->close_mask; - data[8] = attr->extra_flags; - XChangeProperty(dpy, window, _XA_GNUSTEP_WM_ATTR, _XA_GNUSTEP_WM_ATTR, - 32, PropModeReplace, (unsigned char *)data, 9); -} - int PropGetWindowState(Window window) { long *data; diff --git a/src/properties.h b/src/properties.h index dcd735a4..10c73d2e 100644 --- a/src/properties.h +++ b/src/properties.h @@ -33,7 +33,6 @@ int PropGetNormalHints(Window window, XSizeHints *size_hints, int *pre_iccm); void PropGetProtocols(Window window, WProtocols *prots); int PropGetWMClass(Window window, char **wm_class, char **wm_instance); int PropGetGNUstepWMAttr(Window window, GNUstepWMAttributes **attr); -void PropWriteGNUstepWMAttr(Window window, GNUstepWMAttributes *attr); void PropSetWMakerProtocols(Window root); void PropCleanUp(Window root); diff --git a/src/session.c b/src/session.c index 811aee3b..a2795a37 100644 --- a/src/session.c +++ b/src/session.c @@ -554,77 +554,3 @@ void wSessionRestoreLastWorkspace(WScreen * scr) wWorkspaceChange(scr, w); } } - -static void clearWaitingAckState(WScreen * scr) -{ - WWindow *wwin; - WApplication *wapp; - - for (wwin = scr->focused_window; wwin != NULL; wwin = wwin->prev) { - wwin->flags.waiting_save_ack = 0; - if (wwin->main_window != None) { - wapp = wApplicationOf(wwin->main_window); - if (wapp) - wapp->main_window_desc->flags.waiting_save_ack = 0; - } - } -} - -void wSessionSaveClients(WScreen * scr) -{ - -} - -/* - * With XSMP, this job is done by smproxy - */ -void wSessionSendSaveYourself(WScreen * scr) -{ - WWindow *wwin; - int count; - - /* freeze client interaction with clients */ - XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync, CurrentTime); - XGrabPointer(dpy, scr->root_win, False, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, scr->root_win, None, CurrentTime); - - clearWaitingAckState(scr); - - count = 0; - - /* first send SAVE_YOURSELF for everybody */ - for (wwin = scr->focused_window; wwin != NULL; wwin = wwin->prev) { - WWindow *mainWin; - - mainWin = wWindowFor(wwin->main_window); - - if (mainWin) { - /* if the client is a multi-window client, only send message - * to the main window */ - wwin = mainWin; - } - - /* make sure the SAVE_YOURSELF flag is up-to-date */ - PropGetProtocols(wwin->client_win, &wwin->protocols); - - if (wwin->protocols.SAVE_YOURSELF) { - if (!wwin->flags.waiting_save_ack) { - wClientSendProtocol(wwin, _XA_WM_SAVE_YOURSELF, LastTimestamp); - - wwin->flags.waiting_save_ack = 1; - count++; - } - } else { - wwin->flags.waiting_save_ack = 0; - } - } - - /* then wait for acknowledge */ - while (count > 0) { - - } - - XUngrabPointer(dpy, CurrentTime); - XUngrabKeyboard(dpy, CurrentTime); - XFlush(dpy); -} diff --git a/src/session.h b/src/session.h index 3c083c78..0b0e5207 100644 --- a/src/session.h +++ b/src/session.h @@ -43,19 +43,9 @@ typedef struct { char user_changed_height; } WSessionData; - void wSessionSaveState(WScreen *scr); - -void wSessionSaveClients(WScreen *scr); - -void wSessionSendSaveYourself(WScreen *scr); - void wSessionClearState(WScreen *scr); - void wSessionRestoreState(WScreen *scr); - void wSessionRestoreLastWorkspace(WScreen *scr); - Bool wSessionGetStateFor(WWindow *wwin, WSessionData *state); - #endif diff --git a/src/shutdown.c b/src/shutdown.c index f0b137d4..0cf9ab70 100644 --- a/src/shutdown.c +++ b/src/shutdown.c @@ -76,9 +76,6 @@ void Shutdown(WShutdownMode mode) if (scr->helper_pid) kill(scr->helper_pid, SIGKILL); - /* if the session is not being managed, save restart info */ - wSessionSaveClients(scr); - wScreenSaveState(scr); if (mode == WSKillMode) diff --git a/src/xdnd.c b/src/xdnd.c index 86c35536..5230da5f 100644 --- a/src/xdnd.c +++ b/src/xdnd.c @@ -84,11 +84,6 @@ void wXDNDMakeAwareness(Window window) */ } -void wXDNDClearAwareness(Window window) -{ - XDeleteProperty(dpy, window, _XA_XdndAware); -} - Bool wXDNDProcessSelection(XEvent * event) { WScreen *scr = wScreenForWindow(event->xselection.requestor); diff --git a/src/xdnd.h b/src/xdnd.h index 23295f16..1ee0e43b 100644 --- a/src/xdnd.h +++ b/src/xdnd.h @@ -1,13 +1,10 @@ - #ifndef _XDND_H_ #define _XDND_H_ - void wXDNDInitializeAtoms(); Bool wXDNDProcessSelection(XEvent *event); Bool wXDNDProcessClientMessage(XClientMessageEvent *event); void wXDNDMakeAwareness(Window window); -void wXDNDClearAwareness(Window window); /* header was ripped from xdnd's example on its page */ -- 2.11.4.GIT