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

Remove DEBUG statements, #if 0 etc

...and some other cleanups.
This commit is contained in:
Carlos R. Mafra
2010-03-17 17:44:14 +01:00
parent cef4fbb422
commit 5178465bb6
21 changed files with 34 additions and 576 deletions

View File

@@ -453,13 +453,6 @@ static void iconDblClick(WObjDescriptor * desc, XEvent * event)
assert(aicon->icon->owner != NULL); assert(aicon->icon->owner != NULL);
wapp = wApplicationOf(aicon->icon->owner->main_window); wapp = wApplicationOf(aicon->icon->owner->main_window);
#ifdef DEBUG0
if (!wapp) {
wwarning("could not find application descriptor for app icon!!");
return;
}
#endif
unhideHere = (event->xbutton.state & ShiftMask); unhideHere = (event->xbutton.state & ShiftMask);
/* go to the last workspace that the user worked on the app */ /* go to the last workspace that the user worked on the app */
@@ -526,9 +519,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
(*desc->handle_mousedown) (desc, event); (*desc->handle_mousedown) (desc, event);
return; return;
} }
#ifdef DEBUG
puts("Moving icon");
#endif
if (event->xbutton.state & MOD_MASK) if (event->xbutton.state & MOD_MASK)
wLowerFrame(icon->core); wLowerFrame(icon->core);
else else
@@ -713,8 +704,4 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event)
break; break;
} }
} }
#ifdef DEBUG
puts("End icon move");
#endif
} }

View File

@@ -231,12 +231,8 @@ WApplication *wApplicationCreate(WWindow * wwin)
WApplication *wapp; WApplication *wapp;
WWindow *leader; WWindow *leader;
if (main_window == None || main_window == scr->root_win) { if (main_window == None || main_window == scr->root_win)
#ifdef DEBUG0
wwarning("trying to create application for %x", (unsigned)main_window);
#endif
return NULL; return NULL;
}
{ {
Window root; Window root;
@@ -397,11 +393,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
if (!tmp) if (!tmp)
extractClientIcon(wapp->app_icon); extractClientIcon(wapp->app_icon);
} }
#ifdef DEBUG
printf("Created application for %x\n", (unsigned)main_window);
#endif
return wapp; return wapp;
} }
@@ -463,10 +454,6 @@ void wApplicationDestroy(WApplication * wapp)
} }
wfree(wapp); wfree(wapp);
#ifdef DEBUG if (wPreferences.auto_arrange_icons)
printf("Destroyed application for %x\n", (unsigned)main_window);
#endif
if (wPreferences.auto_arrange_icons) {
wArrangeIcons(scr, True); wArrangeIcons(scr, True);
}
} }

View File

@@ -466,11 +466,6 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
case 7: case 7:
break; break;
} }
#ifdef DEBUG
if (i) {
printf("window leader update caused state transition %i\n", i);
}
#endif
if (wwin->wm_hints) { if (wwin->wm_hints) {
/* update icon */ /* update icon */

View File

@@ -113,10 +113,6 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl
if (hasModifier) { if (hasModifier) {
keymap = XGetModifierMapping(dpy); keymap = XGetModifierMapping(dpy);
#ifdef DEBUG
printf("Grabbing keyboard\n");
#endif
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync, CurrentTime); XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync, CurrentTime);
} }

View File

@@ -1070,9 +1070,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
} }
if (plvalue) { if (plvalue) {
#ifdef DEBUG
printf("Updating %s to %s\n", entry->key, WMGetPropListDescription(plvalue, False));
#endif
/* convert data */ /* convert data */
if ((*entry->convert) (scr, entry, plvalue, entry->addr, &tdata)) { if ((*entry->convert) (scr, entry, plvalue, entry->addr, &tdata)) {
/* /*

View File

@@ -3358,9 +3358,6 @@ static void handleDockMove(WDock * dock, WAppIcon * aicon, XEvent * event)
Pixmap ghost = None; Pixmap ghost = None;
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */ int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
#ifdef DEBUG
puts("moving dock");
#endif
if (XGrabPointer(dpy, aicon->icon->core->window, True, ButtonMotionMask if (XGrabPointer(dpy, aicon->icon->core->window, True, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
@@ -3495,9 +3492,6 @@ static void handleDockMove(WDock * dock, WAppIcon * aicon, XEvent * event)
XFreePixmap(dpy, ghost); XFreePixmap(dpy, ghost);
XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel); XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
} }
#ifdef DEBUG
puts("End dock move");
#endif
} }
static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
@@ -3525,9 +3519,6 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for icon move");
#endif
} }
if (!(event->xbutton.state & MOD_MASK)) if (!(event->xbutton.state & MOD_MASK))
@@ -3705,9 +3696,6 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
wDockHideIcons(scr->workspaces[i]->clip); wDockHideIcons(scr->workspaces[i]->clip);
} }
} }
#ifdef DEBUG
puts("End icon move");
#endif
return hasMoved;; return hasMoved;;
} }
} }
@@ -3818,9 +3806,6 @@ static void iconMouseDown(WObjDescriptor * desc, XEvent * event)
XUnmapWindow(dpy, scr->clip_balloon); XUnmapWindow(dpy, scr->clip_balloon);
scr->flags.clip_balloon_mapped = 0; scr->flags.clip_balloon_mapped = 0;
} }
#ifdef DEBUG
puts("handling dock");
#endif
if (event->xbutton.button == Button1) { if (event->xbutton.button == Button1) {
if (event->xbutton.state & MOD_MASK) if (event->xbutton.state & MOD_MASK)
wDockLower(dock); wDockLower(dock);

View File

@@ -558,9 +558,6 @@ static void handleMapRequest(XEvent * ev)
WScreen *scr = NULL; WScreen *scr = NULL;
Window window = ev->xmaprequest.window; Window window = ev->xmaprequest.window;
#ifdef DEBUG
printf("got map request for %x\n", (unsigned)window);
#endif
if ((wwin = wWindowFor(window))) { if ((wwin = wWindowFor(window))) {
if (wwin->flags.shaded) { if (wwin->flags.shaded) {
wUnshadeWindow(wwin); wUnshadeWindow(wwin);
@@ -635,9 +632,6 @@ static void handleDestroyNotify(XEvent * event)
WScreen *scr = wScreenForRootWindow(event->xdestroywindow.event); WScreen *scr = wScreenForRootWindow(event->xdestroywindow.event);
int widx; int widx;
#ifdef DEBUG
printf("got destroy notify\n");
#endif
wwin = wWindowFor(window); wwin = wWindowFor(window);
if (wwin) { if (wwin) {
wUnmanageWindow(wwin, False, True); wUnmanageWindow(wwin, False, True);
@@ -681,9 +675,6 @@ static void handleExpose(XEvent * event)
WObjDescriptor *desc; WObjDescriptor *desc;
XEvent ev; XEvent ev;
#ifdef DEBUG
printf("got expose\n");
#endif
while (XCheckTypedWindowEvent(dpy, event->xexpose.window, Expose, &ev)) ; while (XCheckTypedWindowEvent(dpy, event->xexpose.window, Expose, &ev)) ;
if (XFindContext(dpy, event->xexpose.window, wWinContext, (XPointer *) & desc) == XCNOENT) { if (XFindContext(dpy, event->xexpose.window, wWinContext, (XPointer *) & desc) == XCNOENT) {
@@ -732,9 +723,6 @@ static void handleButtonPress(XEvent * event)
WObjDescriptor *desc; WObjDescriptor *desc;
WScreen *scr; WScreen *scr;
#ifdef DEBUG
printf("got button press\n");
#endif
scr = wScreenForRootWindow(event->xbutton.root); scr = wScreenForRootWindow(event->xbutton.root);
#ifdef BALLOON_TEXT #ifdef BALLOON_TEXT
@@ -802,9 +790,7 @@ static void handleButtonPress(XEvent * event)
static void handleMapNotify(XEvent * event) static void handleMapNotify(XEvent * event)
{ {
WWindow *wwin; WWindow *wwin;
#ifdef DEBUG
printf("got map\n");
#endif
wwin = wWindowFor(event->xmap.event); wwin = wWindowFor(event->xmap.event);
if (wwin && wwin->client_win == event->xmap.event) { if (wwin && wwin->client_win == event->xmap.event) {
if (wwin->flags.miniaturized) { if (wwin->flags.miniaturized) {
@@ -823,9 +809,7 @@ static void handleUnmapNotify(XEvent * event)
WWindow *wwin; WWindow *wwin;
XEvent ev; XEvent ev;
Bool withdraw = False; Bool withdraw = False;
#ifdef DEBUG
printf("got unmap\n");
#endif
/* only process windows with StructureNotify selected /* only process windows with StructureNotify selected
* (ignore SubstructureNotify) */ * (ignore SubstructureNotify) */
wwin = wWindowFor(event->xunmap.window); wwin = wWindowFor(event->xunmap.window);
@@ -872,9 +856,7 @@ static void handleUnmapNotify(XEvent * event)
static void handleConfigureRequest(XEvent * event) static void handleConfigureRequest(XEvent * event)
{ {
WWindow *wwin; WWindow *wwin;
#ifdef DEBUG
printf("got configure request\n");
#endif
if (!(wwin = wWindowFor(event->xconfigurerequest.window))) { if (!(wwin = wWindowFor(event->xconfigurerequest.window))) {
/* /*
* Configure request for unmapped window * Configure request for unmapped window
@@ -893,9 +875,6 @@ static void handlePropertyNotify(XEvent * event)
int ji; int ji;
unsigned int ju; unsigned int ju;
WScreen *scr; WScreen *scr;
#ifdef DEBUG
printf("got property notify\n");
#endif
wwin = wWindowFor(event->xproperty.window); wwin = wWindowFor(event->xproperty.window);
if (wwin) { if (wwin) {
@@ -916,9 +895,7 @@ static void handleClientMessage(XEvent * event)
{ {
WWindow *wwin; WWindow *wwin;
WObjDescriptor *desc; WObjDescriptor *desc;
#ifdef DEBUG
printf("got client message\n");
#endif
/* handle transition from Normal to Iconic state */ /* handle transition from Normal to Iconic state */
if (event->xclient.message_type == _XA_WM_CHANGE_STATE if (event->xclient.message_type == _XA_WM_CHANGE_STATE
&& event->xclient.format == 32 && event->xclient.data.l[0] == IconicState) { && event->xclient.format == 32 && event->xclient.data.l[0] == IconicState) {
@@ -1062,9 +1039,6 @@ static void handleEnterNotify(XEvent * event)
WObjDescriptor *desc = NULL; WObjDescriptor *desc = NULL;
XEvent ev; XEvent ev;
WScreen *scr = wScreenForRootWindow(event->xcrossing.root); WScreen *scr = wScreenForRootWindow(event->xcrossing.root);
#ifdef DEBUG
printf("got enter notify\n");
#endif
if (XCheckTypedWindowEvent(dpy, event->xcrossing.window, LeaveNotify, &ev)) { if (XCheckTypedWindowEvent(dpy, event->xcrossing.window, LeaveNotify, &ev)) {
/* already left the window... */ /* already left the window... */
@@ -1163,9 +1137,7 @@ static void handleShapeNotify(XEvent * event)
XShapeEvent *shev = (XShapeEvent *) event; XShapeEvent *shev = (XShapeEvent *) event;
WWindow *wwin; WWindow *wwin;
XEvent ev; XEvent ev;
#ifdef DEBUG
printf("got shape notify\n");
#endif
while (XCheckTypedWindowEvent(dpy, shev->window, event->type, &ev)) { while (XCheckTypedWindowEvent(dpy, shev->window, event->type, &ev)) {
XShapeEvent *sev = (XShapeEvent *) & ev; XShapeEvent *sev = (XShapeEvent *) & ev;
@@ -1712,9 +1684,7 @@ static void handleMotionNotify(XEvent * event)
p.x >= (rect.pos.x + rect.size.width - 2) || p.x >= (rect.pos.x + rect.size.width - 2) ||
p.y <= (rect.pos.y + 1) || p.y >= (rect.pos.y + rect.size.height - 2)) { p.y <= (rect.pos.y + 1) || p.y >= (rect.pos.y + rect.size.height - 2)) {
WMenu *menu; WMenu *menu;
#ifdef DEBUG
printf("pointer at screen edge\n");
#endif
menu = wMenuUnderPointer(scr); menu = wMenuUnderPointer(scr);
if (menu != NULL) if (menu != NULL)
wMenuScroll(menu, event); wMenuScroll(menu, event);

View File

@@ -380,20 +380,6 @@ RImage *wIconValidateIconSize(WScreen * scr, RImage * icon)
icon = tmp; icon = tmp;
} }
#endif #endif
#if 0
if (icon->width > wPreferences.icon_size || icon->height > wPreferences.icon_size) {
if (icon->width > icon->height) {
w = wPreferences.icon_size - 4;
h = w * icon->height / icon->width;
} else {
h = wPreferences.icon_size - 4;
w = h * icon->width / icon->height;
}
tmp = RScaleImage(icon, w, h);
RReleaseImage(icon);
icon = tmp;
}
#endif
return icon; return icon;
} }
@@ -803,9 +789,7 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
miniwindowDblClick(desc, event); miniwindowDblClick(desc, event);
return; return;
} }
#ifdef DEBUG
puts("Moving miniwindow");
#endif
if (event->xbutton.button == Button1) { if (event->xbutton.button == Button1) {
if (event->xbutton.state & MOD_MASK) if (event->xbutton.state & MOD_MASK)
wLowerFrame(icon->core); wLowerFrame(icon->core);
@@ -831,9 +815,6 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
if (XGrabPointer(dpy, icon->core->window, False, ButtonMotionMask if (XGrabPointer(dpy, icon->core->window, False, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for icon move");
#endif
} }
while (1) { while (1) {
WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask WMMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask | ButtonPressMask
@@ -875,9 +856,6 @@ static void miniwindowMouseDown(WObjDescriptor * desc, XEvent * event)
wwin->icon_x = x; wwin->icon_x = x;
wwin->icon_y = y; wwin->icon_y = y;
#ifdef DEBUG
puts("End miniwindow move");
#endif
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
if (wPreferences.auto_arrange_icons) if (wPreferences.auto_arrange_icons)

View File

@@ -436,9 +436,6 @@ void print_help()
puts(_(" --create-stdcmap create the standard colormap hint in PseudoColor visuals")); puts(_(" --create-stdcmap create the standard colormap hint in PseudoColor visuals"));
puts(_(" --visual-id visualid visual id of visual to use")); puts(_(" --visual-id visualid visual id of visual to use"));
puts(_(" --static do not update or save configurations")); puts(_(" --static do not update or save configurations"));
#ifdef DEBUG
puts(_(" --synchronous turn on synchronous display mode"));
#endif
puts(_(" --version print version and exit")); puts(_(" --version print version and exit"));
puts(_(" --help show this message")); puts(_(" --help show this message"));
} }
@@ -450,11 +447,6 @@ void check_defaults()
path = wdefaultspathfordomain("WindowMaker"); path = wdefaultspathfordomain("WindowMaker");
if (access(path, R_OK) != 0) { if (access(path, R_OK) != 0) {
#if 0
wfatal(_("could not find user GNUstep directory (%s).\n"
"Make sure you have installed Window Maker correctly and run wmaker.inst"), path);
exit(1);
#else
wwarning(_("could not find user GNUstep directory (%s)."), path); wwarning(_("could not find user GNUstep directory (%s)."), path);
if (system("wmaker.inst --batch") != 0) { if (system("wmaker.inst --batch") != 0) {
@@ -463,7 +455,6 @@ void check_defaults()
} else { } else {
wwarning(_("%s directory created with default configuration."), path); wwarning(_("%s directory created with default configuration."), path);
} }
#endif
} }
wfree(path); wfree(path);
@@ -514,13 +505,6 @@ static void execInitScript()
if (system(file) != 0) { if (system(file) != 0) {
wsyserror(_("%s:could not execute initialization script"), file); wsyserror(_("%s:could not execute initialization script"), file);
} }
#if 0
if (fork() == 0) {
execl("/bin/sh", "/bin/sh", "-c", file, NULL);
wsyserror(_("%s:could not execute initialization script"), file);
exit(1);
}
#endif
wfree(file); wfree(file);
} }
} }
@@ -539,52 +523,10 @@ void ExecExitScript()
if (system(file) != 0) { if (system(file) != 0) {
wsyserror(_("%s:could not execute exit script"), file); wsyserror(_("%s:could not execute exit script"), file);
} }
#if 0
if (fork() == 0) {
execl("/bin/sh", "/bin/sh", "-c", file, NULL);
wsyserror(_("%s:could not execute exit script"), file);
exit(1);
}
#endif
wfree(file); wfree(file);
} }
} }
#if 0
char *getFullPath(char *path)
{
char buffer[1024];
char *tmp;
char *basep = (char *)buffer;
if (*path != '/' && getcwd(buffer, 1023)) {
for (;;) {
if (strncmp(path, "../", 3) == 0) {
path += 3;
basep = strchr(basep, '/');
if (!basep || *path == 0)
break;
}
}
if (*path == '/' || strncmp(path, "./", 2) == 0) {
tmp =}
/*
* path
* ./path
* ../path
* ../../path
*/
} else {
return wstrconcat(path);
}
return tmp;
}
#endif
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int i_am_the_monitor, i, len; int i_am_the_monitor, i, len;
@@ -642,11 +584,8 @@ static int real_main(int argc, char **argv)
char *pos; char *pos;
int d, s; int d, s;
int flag; int flag;
#ifdef DEBUG
Bool doSync = False;
#endif
setlocale(LC_ALL, "");
setlocale(LC_ALL, "");
wsetabort(wAbort); wsetabort(wAbort);
/* for telling WPrefs what's the name of the wmaker binary being ran */ /* for telling WPrefs what's the name of the wmaker binary being ran */
@@ -698,10 +637,6 @@ static int real_main(int argc, char **argv)
} else if (strcmp(argv[i], "--global_defaults_path") == 0) { } else if (strcmp(argv[i], "--global_defaults_path") == 0) {
printf("%s/%s\n", SYSCONFDIR, GLOBAL_DEFAULTS_SUBDIR); printf("%s/%s\n", SYSCONFDIR, GLOBAL_DEFAULTS_SUBDIR);
exit(0); exit(0);
#ifdef DEBUG
} else if (strcmp(argv[i], "--synchronous") == 0) {
doSync = 1;
#endif
} else if (strcmp(argv[i], "-locale") == 0 || strcmp(argv[i], "--locale") == 0) { } else if (strcmp(argv[i], "-locale") == 0 || strcmp(argv[i], "--locale") == 0) {
i++; i++;
if (i >= argc) { if (i >= argc) {
@@ -820,11 +755,6 @@ static int real_main(int argc, char **argv)
DisplayName = XDisplayName(DisplayName); DisplayName = XDisplayName(DisplayName);
setenv("DISPLAY", DisplayName, 1); setenv("DISPLAY", DisplayName, 1);
#ifdef DEBUG
if (doSync)
XSynchronize(dpy, True);
#endif
wXModifierInitialize(); wXModifierInitialize();
StartUp(!multiHead); StartUp(!multiHead);

View File

@@ -171,42 +171,10 @@ char *MakeCPPArgs(char *path)
} while ((buf = strtok(NULL, ":")) != NULL); } while ((buf = strtok(NULL, ":")) != NULL);
#undef arg #undef arg
#ifdef DEBUG
puts("CPP ARGS");
puts(line);
#endif
return line; return line;
} }
#endif /* USECPP */ #endif /* USECPP */
#if 0
/*
* Is win2 below win1?
*/
static Bool isBelow(WWindow * win1, WWindow * win2)
{
int i;
WCoreWindow *tmp;
tmp = win1->frame->core->stacking->under;
while (tmp) {
if (tmp == win2->frame->core)
return True;
tmp = tmp->stacking->under;
}
for (i = win1->frame->core->stacking->window_level - 1; i >= 0; i--) {
tmp = win1->screen_ptr->stacking_list[i];
while (tmp) {
if (tmp == win2->frame->core)
return True;
tmp = tmp->stacking->under;
}
}
return True;
}
#endif
/* XFetchName Wrapper */ /* XFetchName Wrapper */
Bool wFetchName(Display *dpy, Window win, char **winname) Bool wFetchName(Display *dpy, Window win, char **winname)
{ {

View File

@@ -26,20 +26,17 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "WindowMaker.h" #include "WindowMaker.h"
#include "framewin.h" #include "framewin.h"
#include "window.h" #include "window.h"
#include "properties.h" #include "properties.h"
#include "icon.h" #include "icon.h"
#include "client.h" #include "client.h"
#include "funcs.h" #include "funcs.h"
#include "motif.h" #include "motif.h"
/* Motif window hints */ /* Motif window hints */
@@ -47,12 +44,12 @@
#define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_DECORATIONS (1L << 1)
/* bit definitions for MwmHints.functions */ /* bit definitions for MwmHints.functions */
#define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_ALL (1L << 0)
#define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_RESIZE (1L << 1)
#define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MOVE (1L << 2)
#define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MINIMIZE (1L << 3)
#define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_MAXIMIZE (1L << 4)
#define MWM_FUNC_CLOSE (1L << 5) #define MWM_FUNC_CLOSE (1L << 5)
/* bit definitions for MwmHints.decorations */ /* bit definitions for MwmHints.decorations */
#define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_ALL (1L << 0)
@@ -63,8 +60,6 @@
#define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6) #define MWM_DECOR_MAXIMIZE (1L << 6)
#define PROP_MWM_HINTS_ELEMENTS 5
/* Motif window hints */ /* Motif window hints */
typedef struct { typedef struct {
long flags; long flags;
@@ -76,7 +71,7 @@ typedef struct {
static Atom _XA_MOTIF_WM_HINTS; static Atom _XA_MOTIF_WM_HINTS;
static void setupMWMHints(WWindow * wwin, MWMHints * mwm_hints) static void setupMWMHints(WWindow *wwin, MWMHints *mwm_hints)
{ {
/* /*
* We will ignore all decoration hints that have an equivalent as * We will ignore all decoration hints that have an equivalent as
@@ -84,18 +79,12 @@ static void setupMWMHints(WWindow * wwin, MWMHints * mwm_hints)
*/ */
if (mwm_hints->flags & MWM_HINTS_DECORATIONS) { if (mwm_hints->flags & MWM_HINTS_DECORATIONS) {
# ifdef DEBUG
fprintf(stderr, "has decor hints [ ");
# endif
WSETUFLAG(wwin, no_titlebar, 1); WSETUFLAG(wwin, no_titlebar, 1);
WSETUFLAG(wwin, no_close_button, 1); WSETUFLAG(wwin, no_close_button, 1);
WSETUFLAG(wwin, no_miniaturize_button, 1); WSETUFLAG(wwin, no_miniaturize_button, 1);
WSETUFLAG(wwin, no_resizebar, 1); WSETUFLAG(wwin, no_resizebar, 1);
if (mwm_hints->decorations & MWM_DECOR_ALL) { if (mwm_hints->decorations & MWM_DECOR_ALL) {
# ifdef DEBUG
fprintf(stderr, "ALL ");
# endif
WSETUFLAG(wwin, no_titlebar, 0); WSETUFLAG(wwin, no_titlebar, 0);
WSETUFLAG(wwin, no_close_button, 0); WSETUFLAG(wwin, no_close_button, 0);
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
@@ -104,118 +93,54 @@ static void setupMWMHints(WWindow * wwin, MWMHints * mwm_hints)
WSETUFLAG(wwin, no_resizebar, 0); WSETUFLAG(wwin, no_resizebar, 0);
WSETUFLAG(wwin, no_resizable, 0); WSETUFLAG(wwin, no_resizable, 0);
} }
/*
if (mwm_hints->decorations & MWM_DECOR_BORDER) {
# ifdef DEBUG
fprintf(stderr,"(BORDER) ");
# endif
}
*/
if (mwm_hints->decorations & MWM_DECOR_RESIZEH) { if (mwm_hints->decorations & MWM_DECOR_RESIZEH)
# ifdef DEBUG
fprintf(stderr, "RESIZEH ");
# endif
WSETUFLAG(wwin, no_resizebar, 0); WSETUFLAG(wwin, no_resizebar, 0);
}
if (mwm_hints->decorations & MWM_DECOR_TITLE) { if (mwm_hints->decorations & MWM_DECOR_TITLE) {
# ifdef DEBUG
fprintf(stderr, "TITLE+close ");
# endif
WSETUFLAG(wwin, no_titlebar, 0); WSETUFLAG(wwin, no_titlebar, 0);
WSETUFLAG(wwin, no_close_button, 0); WSETUFLAG(wwin, no_close_button, 0);
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
} }
/*
if (mwm_hints->decorations & MWM_DECOR_MENU) {
# ifdef DEBUG
fprintf(stderr,"(MENU) ");
# endif
}
*/
if (mwm_hints->decorations & MWM_DECOR_MINIMIZE) { if (mwm_hints->decorations & MWM_DECOR_MINIMIZE) {
# ifdef DEBUG
fprintf(stderr, "MINIMIZE ");
# endif
WSETUFLAG(wwin, no_miniaturize_button, 0); WSETUFLAG(wwin, no_miniaturize_button, 0);
WSETUFLAG(wwin, no_miniaturizable, 0); WSETUFLAG(wwin, no_miniaturizable, 0);
} }
/*
if (mwm_hints->decorations & MWM_DECOR_MAXIMIZE) {
# ifdef DEBUG
fprintf(stderr,"(MAXIMIZE) ");
# endif
}
*/
# ifdef DEBUG
fprintf(stderr, "]\n");
# endif
} }
if (mwm_hints->flags & MWM_HINTS_FUNCTIONS) { if (mwm_hints->flags & MWM_HINTS_FUNCTIONS) {
# ifdef DEBUG
fprintf(stderr, "has function hints [ ");
# endif
WSETUFLAG(wwin, no_closable, 1); WSETUFLAG(wwin, no_closable, 1);
WSETUFLAG(wwin, no_miniaturizable, 1); WSETUFLAG(wwin, no_miniaturizable, 1);
WSETUFLAG(wwin, no_resizable, 1); WSETUFLAG(wwin, no_resizable, 1);
if (mwm_hints->functions & MWM_FUNC_ALL) { if (mwm_hints->functions & MWM_FUNC_ALL) {
# ifdef DEBUG
fprintf(stderr, "ALL ");
# endif
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
WSETUFLAG(wwin, no_miniaturizable, 0); WSETUFLAG(wwin, no_miniaturizable, 0);
WSETUFLAG(wwin, no_resizable, 0); WSETUFLAG(wwin, no_resizable, 0);
} }
if (mwm_hints->functions & MWM_FUNC_RESIZE) { if (mwm_hints->functions & MWM_FUNC_RESIZE)
# ifdef DEBUG
fprintf(stderr, "RESIZE ");
# endif
WSETUFLAG(wwin, no_resizable, 0); WSETUFLAG(wwin, no_resizable, 0);
}
/* if (mwm_hints->functions & MWM_FUNC_MINIMIZE)
if (mwm_hints->functions & MWM_FUNC_MOVE) {
# ifdef DEBUG
fprintf(stderr,"(MOVE) ");
# endif
}
*/
if (mwm_hints->functions & MWM_FUNC_MINIMIZE) {
# ifdef DEBUG
fprintf(stderr, "MINIMIZE ");
# endif
WSETUFLAG(wwin, no_miniaturizable, 0); WSETUFLAG(wwin, no_miniaturizable, 0);
}
if (mwm_hints->functions & MWM_FUNC_MAXIMIZE) { if (mwm_hints->functions & MWM_FUNC_MAXIMIZE) {
# ifdef DEBUG
fprintf(stderr, "MAXIMIZE ");
/* a window must be resizable to be maximizable */ /* a window must be resizable to be maximizable */
WSETUFLAG(wwin, no_resizable, 0); WSETUFLAG(wwin, no_resizable, 0);
# endif
} }
if (mwm_hints->functions & MWM_FUNC_CLOSE) { if (mwm_hints->functions & MWM_FUNC_CLOSE)
# ifdef DEBUG
fprintf(stderr, "CLOSE ");
# endif
WSETUFLAG(wwin, no_closable, 0); WSETUFLAG(wwin, no_closable, 0);
}
# ifdef DEBUG
fprintf(stderr, "]\n");
# endif
} }
} }
static int getMWMHints(Window window, MWMHints * mwmhints) static int getMWMHints(Window window, MWMHints *mwmhints)
{ {
unsigned long *data; unsigned long *data;
int count; int count;
if (!_XA_MOTIF_WM_HINTS) { if (!_XA_MOTIF_WM_HINTS)
_XA_MOTIF_WM_HINTS = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); _XA_MOTIF_WM_HINTS = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
}
data = (unsigned long *)PropGetCheckProperty(window, _XA_MOTIF_WM_HINTS, data = (unsigned long *)PropGetCheckProperty(window, _XA_MOTIF_WM_HINTS,
_XA_MOTIF_WM_HINTS, 32, 0, &count); _XA_MOTIF_WM_HINTS, 32, 0, &count);
@@ -236,13 +161,12 @@ static int getMWMHints(Window window, MWMHints * mwmhints)
return 1; return 1;
} }
void wMWMCheckClientHints(WWindow * wwin) void wMWMCheckClientHints(WWindow *wwin)
{ {
MWMHints hints; MWMHints hints;
if (getMWMHints(wwin->client_win, &hints)) { if (getMWMHints(wwin->client_win, &hints))
setupMWMHints(wwin, &hints); setupMWMHints(wwin, &hints);
}
} }
#endif /* MWM_HINTS */ #endif /* MWM_HINTS */

View File

@@ -1585,9 +1585,6 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
/* this window is not selected, unselect others and move only wwin */ /* this window is not selected, unselect others and move only wwin */
wUnselectWindows(scr); wUnselectWindows(scr);
} }
#ifdef DEBUG
puts("Moving window");
#endif
shiftl = XKeysymToKeycode(dpy, XK_Shift_L); shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
shiftr = XKeysymToKeycode(dpy, XK_Shift_R); shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
while (!done) { while (!done) {
@@ -1755,9 +1752,6 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
WMUnmapWidget(scr->gview); WMUnmapWidget(scr->gview);
} }
} }
#ifdef DEBUG
puts("End move window");
#endif
done = True; done = True;
break; break;
@@ -1883,10 +1877,6 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
orig_y = ev->xbutton.y_root; orig_y = ev->xbutton.y_root;
started = 0; started = 0;
#ifdef DEBUG
puts("Resizing window");
#endif
wUnselectWindows(scr); wUnselectWindows(scr);
rx1 = fx; rx1 = fx;
rx2 = fx + fw - 1; rx2 = fx + fw - 1;
@@ -2067,9 +2057,6 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
wWindowConfigure(wwin, fx, fy, fw, fh - vert_border); wWindowConfigure(wwin, fx, fy, fw, fh - vert_border);
} }
#ifdef DEBUG
puts("End resize window");
#endif
return; return;
default: default:
@@ -2138,9 +2125,6 @@ void wSelectWindows(WScreen * scr, XEvent * ev)
int w = 0, h = 0; int w = 0, h = 0;
int x = xp, y = yp; int x = xp, y = yp;
#ifdef DEBUG
puts("Selecting windows");
#endif
if (XGrabPointer(dpy, scr->root_win, False, ButtonMotionMask if (XGrabPointer(dpy, scr->root_win, False, ButtonMotionMask
| ButtonReleaseMask | ButtonPressMask, GrabModeAsync, | ButtonReleaseMask | ButtonPressMask, GrabModeAsync,
GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime) != Success) { GrabModeAsync, None, wCursor[WCUR_DEFAULT], CurrentTime) != Success) {
@@ -2185,10 +2169,6 @@ void wSelectWindows(WScreen * scr, XEvent * ev)
XUngrabServer(dpy); XUngrabServer(dpy);
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
selectWindowsInside(scr, x, y, x + w, y + h); selectWindowsInside(scr, x, y, x + w, y + h);
#ifdef DEBUG
puts("End window selection");
#endif
return; return;
default: default:

View File

@@ -134,15 +134,6 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head)
sw = sx2 - sx1; sw = sx2 - sx1;
sh = sy2 - sy1; sh = sy2 - sy1;
#if 0
if (scr->dock) {
if (scr->dock->on_right_side)
sx2 -= isize + DOCK_EXTRA_SPACE;
else
sx1 += isize + DOCK_EXTRA_SPACE;
}
#endif
sw = isize * (sw / isize); sw = isize * (sw / isize);
sh = isize * (sh / isize); sh = isize * (sh / isize);
fullW = (sx2 - sx1) / isize; fullW = (sx2 - sx1) / isize;
@@ -279,16 +270,9 @@ static int calcSumOfCoveredAreas(WWindow *wwin, int x, int y, int w, int h)
if (test_window->frame->core->stacking->window_level < WMNormalLevel) { if (test_window->frame->core->stacking->window_level < WMNormalLevel) {
continue; continue;
} }
#if 0
tw = test_window->client.width;
if (test_window->flags.shaded)
th = test_window->frame->top_width;
else
th = test_window->client.height + extra_height;
#else
tw = test_window->frame->core->width; tw = test_window->frame->core->width;
th = test_window->frame->core->height; th = test_window->frame->core->height;
#endif
tx = test_window->frame_x; tx = test_window->frame_x;
ty = test_window->frame_y; ty = test_window->frame_y;
@@ -409,16 +393,8 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
test_window = test_window->next; test_window = test_window->next;
continue; continue;
} }
#if 0
tw = test_window->client.width;
if (test_window->flags.shaded)
th = test_window->frame->top_width;
else
th = test_window->client.height + extra_height;
#else
tw = test_window->frame->core->width; tw = test_window->frame->core->width;
th = test_window->frame->core->height; th = test_window->frame->core->height;
#endif
tx = test_window->frame_x; tx = test_window->frame_x;
ty = test_window->frame_y; ty = test_window->frame_y;
@@ -443,16 +419,8 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
test_window = test_window->prev; test_window = test_window->prev;
continue; continue;
} }
#if 0
tw = test_window->client.width;
if (test_window->flags.shaded)
th = test_window->frame->top_width;
else
th = test_window->client.height + extra_height;
#else
tw = test_window->frame->core->width; tw = test_window->frame->core->width;
th = test_window->frame->core->height; th = test_window->frame->core->height;
#endif
tx = test_window->frame_x; tx = test_window->frame_x;
ty = test_window->frame_y; ty = test_window->frame_y;
@@ -553,13 +521,6 @@ void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, unsigned width, unsigned
case WPM_RANDOM: case WPM_RANDOM:
randomPlaceWindow(wwin, x_ret, y_ret, width, height, usableArea); randomPlaceWindow(wwin, x_ret, y_ret, width, height, usableArea);
break; break;
#ifdef DEBUG
default:
puts("Invalid window placement!!!");
*x_ret = 0;
*y_ret = 0;
#endif
} }
/* /*

View File

@@ -193,12 +193,9 @@ static void exitCommand(WMenu * menu, WMenuEntry * entry)
wPreferences.save_session_on_exit = oldSaveSessionFlag; wPreferences.save_session_on_exit = oldSaveSessionFlag;
} }
} }
if (result == R_EXIT) { if (result == R_EXIT)
#ifdef DEBUG
printf("Exiting WindowMaker.\n");
#endif
Shutdown(WSExitMode); Shutdown(WSExitMode);
}
#undef R_EXIT #undef R_EXIT
#undef R_CANCEL #undef R_CANCEL
inside = 0; inside = 0;

View File

@@ -97,11 +97,6 @@ void RemakeStackList(WScreen * scr)
WMSetInBag(scr->stacking_list, level, frame); WMSetInBag(scr->stacking_list, level, frame);
} }
XFree(windows); XFree(windows);
#ifdef DEBUG
if (c != scr->window_count) {
puts("Found different number of windows than in window lists!!!");
}
#endif
scr->window_count = c; scr->window_count = c;
} }
@@ -132,14 +127,6 @@ void CommitStacking(WScreen * scr)
i = 0; i = 0;
WM_ETARETI_BAG(scr->stacking_list, tmp, iter) { WM_ETARETI_BAG(scr->stacking_list, tmp, iter) {
while (tmp) { while (tmp) {
#ifdef DEBUG
if (i >= nwindows) {
puts("Internal inconsistency! window_count is incorrect!!!");
printf("window_count says %i windows\n", nwindows);
wfree(windows);
return;
}
#endif
windows[i++] = tmp->window; windows[i++] = tmp->window;
tmp = tmp->stacking->under; tmp = tmp->stacking->under;
} }

View File

@@ -134,9 +134,6 @@ extern Atom _XA_WM_IGNORE_FOCUS_EVENTS;
/* cursors */ /* cursors */
extern Cursor wCursor[WCUR_LAST]; extern Cursor wCursor[WCUR_LAST];
/* special flags */
/*extern char WDelayedActionSet;*/
/***** Local *****/ /***** Local *****/
static WScreen **wScreen = NULL; static WScreen **wScreen = NULL;
@@ -170,14 +167,7 @@ static int catchXError(Display * dpy, XErrorEvent * error)
|| error->request_code == X_ConfigureWindow)) || error->request_code == X_ConfigureWindow))
*/ */
|| (error->request_code == X_InstallColormap))) { || (error->request_code == X_InstallColormap))) {
#ifndef DEBUG
return 0; return 0;
#else
printf("got X error %x %x %x\n", error->request_code,
error->error_code, (unsigned)error->resourceid);
return 0;
#endif
} }
FormatXError(dpy, error, buffer, MAXLINE); FormatXError(dpy, error, buffer, MAXLINE);
wwarning(_("internal X error: %s\n"), buffer); wwarning(_("internal X error: %s\n"), buffer);
@@ -197,29 +187,6 @@ static int handleXIO(Display * xio_dpy)
return 0; return 0;
} }
/*
*----------------------------------------------------------------------
* delayedAction-
* Action to be executed after the signal() handler is exited.
* This was called every 500ms to 'clean up' signals. Not used now.
*----------------------------------------------------------------------
*/
#ifdef notused
static void delayedAction(void *cdata)
{
if (WDelayedActionSet == 0) {
return;
}
WDelayedActionSet--;
/*
* Make the event dispatcher do whatever it needs to do,
* including handling zombie processes, restart and exit
* signals.
*/
DispatchEvent(NULL);
}
#endif
/* /*
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* handleExitSig-- * handleExitSig--

View File

@@ -42,16 +42,6 @@
(((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF)) (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF))
#endif #endif
#ifdef DEBUG
# define ENTER(X) fprintf(stderr,"Entering: %s()\n", X);
# define LEAVE(X) fprintf(stderr,"Leaving: %s()\n", X);
# define PDEBUG(X) fprintf(stderr,"debug: %s()\n", X);
#else
# define ENTER(X)
# define LEAVE(X)
# define PDEBUG(X)
#endif
extern Cursor wCursor[WCUR_LAST]; extern Cursor wCursor[WCUR_LAST];
/******************************************************************** /********************************************************************
@@ -62,9 +52,6 @@ static void textEventHandler(WObjDescriptor * desc, XEvent * event);
static void handleExpose(WObjDescriptor * desc, XEvent * event); static void handleExpose(WObjDescriptor * desc, XEvent * event);
static void textInsert(WTextInput * wtext, char *txt); static void textInsert(WTextInput * wtext, char *txt);
#if 0
static void blink(void *data);
#endif
/******************************************************************** /********************************************************************
* handleKeyPress * * handleKeyPress *
@@ -189,8 +176,6 @@ WTextInput *wTextCreate(WCoreWindow * core, int x, int y, int width, int height)
{ {
WTextInput *wtext; WTextInput *wtext;
ENTER("wTextCreate");
wtext = wmalloc(sizeof(WTextInput)); wtext = wmalloc(sizeof(WTextInput));
wtext->core = wCoreCreate(core, x, y, width, height); wtext->core = wCoreCreate(core, x, y, width, height);
wtext->core->descriptor.handle_anything = &textEventHandler; wtext->core->descriptor.handle_anything = &textEventHandler;
@@ -248,9 +233,6 @@ WTextInput *wTextCreate(WCoreWindow * core, int x, int y, int width, int height)
* hits "Return" key */ * hits "Return" key */
XMapRaised(dpy, wtext->core->window); XMapRaised(dpy, wtext->core->window);
LEAVE("wTextCreate");
return wtext; return wtext;
} }
@@ -263,20 +245,12 @@ WTextInput *wTextCreate(WCoreWindow * core, int x, int y, int width, int height)
********************************************************************/ ********************************************************************/
void wTextDestroy(WTextInput * wtext) void wTextDestroy(WTextInput * wtext)
{ {
ENTER("wTextDestroy")
#if 0
if (wtext->magic)
wDeleteTimerHandler(wtext->magic);
wtext->magic = NULL;
#endif
XFreeGC(dpy, wtext->gc); XFreeGC(dpy, wtext->gc);
XFreeGC(dpy, wtext->regGC); XFreeGC(dpy, wtext->regGC);
XFreeGC(dpy, wtext->invGC); XFreeGC(dpy, wtext->invGC);
wfree(wtext->text.txt); wfree(wtext->text.txt);
wCoreDestroy(wtext->core); wCoreDestroy(wtext->core);
wfree(wtext); wfree(wtext);
LEAVE("wTextDestroy");
} }
/* The text-field consists of a frame drawn around the outside, /* The text-field consists of a frame drawn around the outside,
@@ -361,15 +335,12 @@ static void textRefresh(WTextInput * wtext)
********************************************************************/ ********************************************************************/
void wTextPaint(WTextInput * wtext) void wTextPaint(WTextInput * wtext)
{ {
ENTER("wTextPaint");
/* refresh */ /* refresh */
textRefresh(wtext); textRefresh(wtext);
/* Draw box */ /* Draw box */
XDrawRectangle(dpy, wtext->core->window, wtext->gc, 0, 0, wtext->core->width - 1, wtext->core->height - 1); XDrawRectangle(dpy, wtext->core->window, wtext->gc, 0, 0,
wtext->core->width - 1, wtext->core->height - 1);
LEAVE("wTextPaint");
} }
/******************************************************************** /********************************************************************
@@ -495,30 +466,6 @@ void wTextSelect(WTextInput * wtext, int start, int end)
wtext->text.startPos = start; wtext->text.startPos = start;
} }
#if 0
static void blink(void *data)
{
int x;
WTextInput *wtext = (WTextInput *) data;
GC gc;
/* And draw a quick little line for the cursor position */
if (wtext->blink_on) {
gc = wtext->regGC;
wtext->blink_on = 0;
} else {
gc = wtext->invGC;
wtext->blink_on = 1;
}
x = WMWidthOfString(wtext->font, wtext->text.txt, wtext->text.endPos)
+ wtext->xOffset;
XDrawLine(dpy, wtext->core->window, gc, x, 2, x, wtext->core->height - 3);
if (wtext->blinking)
wtext->magic = wAddTimerHandler(CURSOR_BLINK_RATE, blink, data);
}
#endif
/******************************************************************** /********************************************************************
* textEventHandler -- handles and dispatches all the events that * * textEventHandler -- handles and dispatches all the events that *
* the text field class supports * * the text field class supports *
@@ -538,54 +485,32 @@ static void textEventHandler(WObjDescriptor * desc, XEvent * event)
* event, but otherwise we want to adjust the selected * event, but otherwise we want to adjust the selected
* text so we can wTextRefresh() */ * text so we can wTextRefresh() */
if (event->xmotion.state & (Button1Mask | Button3Mask | Button2Mask)) { if (event->xmotion.state & (Button1Mask | Button3Mask | Button2Mask)) {
PDEBUG("MotionNotify");
handled = True; handled = True;
wtext->text.endPos = textXtoPos(wtext, event->xmotion.x); wtext->text.endPos = textXtoPos(wtext, event->xmotion.x);
} }
break; break;
case ButtonPress: case ButtonPress:
PDEBUG("ButtonPress");
handled = True; handled = True;
wtext->text.startPos = textXtoPos(wtext, event->xbutton.x); wtext->text.startPos = textXtoPos(wtext, event->xbutton.x);
wtext->text.endPos = wtext->text.startPos; wtext->text.endPos = wtext->text.startPos;
break; break;
case ButtonRelease: case ButtonRelease:
PDEBUG("ButtonRelease");
handled = True; handled = True;
wtext->text.endPos = textXtoPos(wtext, event->xbutton.x); wtext->text.endPos = textXtoPos(wtext, event->xbutton.x);
break; break;
case KeyPress: case KeyPress:
PDEBUG("KeyPress");
handled = handleKeyPress(wtext, &event->xkey); handled = handleKeyPress(wtext, &event->xkey);
break; break;
case EnterNotify: case EnterNotify:
PDEBUG("EnterNotify");
handled = True; handled = True;
#if 0
if (!wtext->magic) {
wtext->magic = wAddTimerHandler(CURSOR_BLINK_RATE, blink, wtext);
wtext->blink_on = !wtext->blink_on;
blink(wtext);
wtext->blinking = 1;
}
#endif
break; break;
case LeaveNotify: case LeaveNotify:
PDEBUG("LeaveNotify");
handled = True; handled = True;
#if 0
wtext->blinking = 0;
if (wtext->blink_on)
blink(wtext);
if (wtext->magic)
wDeleteTimerHandler(wtext->magic);
wtext->magic = NULL;
#endif
break; break;
default: default:

View File

@@ -116,9 +116,6 @@ WTexSolid *wTextureMakeSolid(WScreen * scr, XColor * color)
static int dummyErrorHandler(Display * foo, XErrorEvent * bar) static int dummyErrorHandler(Display * foo, XErrorEvent * bar)
{ {
#ifdef DEBUG
wwarning("your server is buggy. Tell the author if some error related to color occurs");
#endif
return 0; return 0;
} }
@@ -128,13 +125,6 @@ void wTextureDestroy(WScreen * scr, WTexture * texture)
int count = 0; int count = 0;
unsigned long colors[8]; unsigned long colors[8];
#ifdef DEBUG
if (texture == NULL) {
printf("BUG: trying to free NULL texture\n");
return;
}
#endif
/* /*
* some stupid servers don't like white or black being freed... * some stupid servers don't like white or black being freed...
*/ */
@@ -672,24 +662,5 @@ void wDrawBevel(Drawable d, unsigned width, unsigned height, WTexSolid * texture
XDrawSegments(dpy, d, light, segs, 2); XDrawSegments(dpy, d, light, segs, 2);
} }
break; break;
#ifdef unused
case WREL_SUNKEN:
segs[0].x1 = 0;
segs[0].x2 = width - 1;
segs[0].y2 = segs[0].y1 = 0;
segs[1].x1 = segs[1].x2 = 0;
segs[1].y1 = 0;
segs[1].y2 = height - 1;
XDrawSegments(dpy, d, dark, segs, 2);
segs[0].x1 = 0;
segs[0].y1 = segs[0].y2 = height - 1;
segs[0].x2 = width - 1;
segs[1].x2 = segs[1].x1 = width - 1;
segs[1].y1 = 1;
segs[1].y2 = height - 1;
XDrawSegments(dpy, d, light, segs, 2);
break;
#endif
} }
} }

View File

@@ -393,8 +393,6 @@
# define DEFAULT_PATH_MAX 512 # define DEFAULT_PATH_MAX 512
#endif #endif
#define DEBUG0
/* some rules */ /* some rules */
#ifndef SHAPE #ifndef SHAPE
#undef SHAPED_BALLOON #undef SHAPED_BALLOON

View File

@@ -644,10 +644,6 @@ WWindow *wManageWindow(WScreen *scr, Window window)
XSaveContext(dpy, window, wWinContext, (XPointer) & wwin->client_descriptor); XSaveContext(dpy, window, wWinContext, (XPointer) & wwin->client_descriptor);
#ifdef DEBUG
printf("managing window %x\n", (unsigned)window);
#endif
#ifdef SHAPE #ifdef SHAPE
if (wShapeSupported) { if (wShapeSupported) {
int junk; int junk;
@@ -1678,10 +1674,6 @@ void wUnmanageWindow(WWindow *wwin, Bool restore, Bool destroyed)
if (!wwin->flags.internal_window) if (!wwin->flags.internal_window)
WMPostNotificationName(WMNUnmanaged, wwin, NULL); WMPostNotificationName(WMNUnmanaged, wwin, NULL);
#ifdef DEBUG
printf("destroying window %x frame %x\n", (unsigned)wwin->client_win, (unsigned)frame->window);
#endif
if (wasFocused) { if (wasFocused) {
if (newFocusedWindow != owner && owner) { if (newFocusedWindow != owner && owner) {
if (wwin->flags.is_gnustep == 0) if (wwin->flags.is_gnustep == 0)
@@ -2634,10 +2626,6 @@ WMagicNumber wWindowAddSavedState(char *instance, char *class, char *command, pi
wstate->next = windowState; wstate->next = windowState;
windowState = wstate; windowState = wstate;
#ifdef DEBUG
printf("Added WindowState with ID %p, for %s.%s : \"%s\"\n", wstate, instance, class, command);
#endif
return wstate; return wstate;
} }
@@ -2667,10 +2655,6 @@ WMagicNumber wWindowGetSavedState(Window win)
wstate = NULL; wstate = NULL;
} }
#ifdef DEBUG
printf("Read WindowState with ID %p, for %s.%s : \"%s\"\n", wstate, instance, class, command);
#endif
if (command) if (command)
wfree(command); wfree(command);
if (instance) if (instance)
@@ -2691,10 +2675,6 @@ void wWindowDeleteSavedState(WMagicNumber id)
tmp = windowState; tmp = windowState;
if (tmp == wstate) { if (tmp == wstate) {
windowState = wstate->next; windowState = wstate->next;
#ifdef DEBUG
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) if (wstate->instance)
wfree(wstate->instance); wfree(wstate->instance);
if (wstate->class) if (wstate->class)
@@ -2707,10 +2687,6 @@ void wWindowDeleteSavedState(WMagicNumber id)
while (tmp->next) { while (tmp->next) {
if (tmp->next == wstate) { if (tmp->next == wstate) {
tmp->next = wstate->next; tmp->next = wstate->next;
#ifdef DEBUG
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) if (wstate->instance)
wfree(wstate->instance); wfree(wstate->instance);
if (wstate->class) if (wstate->class)
@@ -2737,10 +2713,6 @@ void wWindowDeleteSavedStatesForPID(pid_t pid)
if (tmp->pid == pid) { if (tmp->pid == pid) {
wstate = windowState; wstate = windowState;
windowState = tmp->next; windowState = tmp->next;
#ifdef DEBUG
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) if (wstate->instance)
wfree(wstate->instance); wfree(wstate->instance);
if (wstate->class) if (wstate->class)
@@ -2754,10 +2726,6 @@ void wWindowDeleteSavedStatesForPID(pid_t pid)
if (tmp->next->pid == pid) { if (tmp->next->pid == pid) {
wstate = tmp->next; wstate = tmp->next;
tmp->next = wstate->next; tmp->next = wstate->next;
#ifdef DEBUG
printf("Deleted WindowState with ID %p, for %s.%s : \"%s\"\n",
wstate, wstate->instance, wstate->class, wstate->command);
#endif
if (wstate->instance) if (wstate->instance)
wfree(wstate->instance); wfree(wstate->instance);
if (wstate->class) if (wstate->class)
@@ -2810,9 +2778,6 @@ static void resizebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
if (XGrabPointer(dpy, wwin->frame->resizebar->window, True, if (XGrabPointer(dpy, wwin->frame->resizebar->window, True,
ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for window move");
#endif
return; return;
} }
} }
@@ -2924,9 +2889,6 @@ static void frameMouseDown(WObjDescriptor *desc, XEvent *event)
if (XGrabPointer(dpy, wwin->client_win, False, if (XGrabPointer(dpy, wwin->client_win, False,
ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for window move");
#endif
return; return;
} }
if (event->xbutton.button == Button3) { if (event->xbutton.button == Button3) {
@@ -2984,9 +2946,6 @@ static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
&& XGrabPointer(dpy, wwin->frame->titlebar->window, False, && XGrabPointer(dpy, wwin->frame->titlebar->window, False,
ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for window move");
#endif
return; return;
} }
@@ -3002,9 +2961,6 @@ static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
&& XGrabPointer(dpy, wwin->frame->titlebar->window, False, && XGrabPointer(dpy, wwin->frame->titlebar->window, False,
ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) { GrabModeAsync, GrabModeAsync, None, None, CurrentTime) != GrabSuccess) {
#ifdef DEBUG0
wwarning("pointer grab failed for window move");
#endif
return; return;
} }

View File

@@ -26,7 +26,6 @@ char *path;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int fd;
char *locale; char *locale;
extern char *path; extern char *path;