From 799134f59bd764230cbde5c4d376e6faed404f76 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Sun, 19 Feb 2012 01:29:18 +0000 Subject: [PATCH] Remove wShowGNUstepPanel() etc The only place where this function is called is from a double click in the first icon of the dock, and only if there's no program already associated with it. This is a bit superfluous and most people have defined the first icon to call WPrefs instead and end up never seeing that panel. And since the last commit ("Change behaviour of the GNUstep dockapp"), this is now also the default behaviour of Window Maker. Furthermore, the panel itself is not accurate. Window Maker is not part of the GNUstep project. --- src/dialog.c | 166 ----------------------------------------------------------- src/dialog.h | 4 -- src/dock.c | 5 +- 3 files changed, 1 insertion(+), 174 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index acfb777c..e4c8f345 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1631,169 +1631,3 @@ int wShowCrashingDialogPanel(int whatSig) return action; } - -/***************************************************************************** - * About GNUstep Panel - *****************************************************************************/ - -static void -drawGNUstepLogo(Display * dpy, Drawable d, int width, int height, - unsigned long blackPixel, unsigned long whitePixel) -{ - GC gc; - XGCValues gcv; - XRectangle rects[3]; - - gcv.foreground = blackPixel; - gc = XCreateGC(dpy, d, GCForeground, &gcv); - - XFillArc(dpy, d, gc, width / 45, height / 45, - width - 2 * width / 45, height - 2 * height / 45, 0, 360 * 64); - - rects[0].x = 0; - rects[0].y = 37 * height / 45; - rects[0].width = width / 3; - rects[0].height = height - rects[0].y; - - rects[1].x = rects[0].width; - rects[1].y = height / 2; - rects[1].width = width - 2 * width / 3; - rects[1].height = height - rects[1].y; - - rects[2].x = 2 * width / 3; - rects[2].y = height - 37 * height / 45; - rects[2].width = width / 3; - rects[2].height = height - rects[2].y; - - XSetClipRectangles(dpy, gc, 0, 0, rects, 3, Unsorted); - XFillRectangle(dpy, d, gc, 0, 0, width, height); - - XSetForeground(dpy, gc, whitePixel); - XFillArc(dpy, d, gc, width / 45, height / 45, - width - 2 * width / 45, height - 2 * height / 45, 0, 360 * 64); - - XFreeGC(dpy, gc); -} - -typedef struct { - WScreen *scr; - - WWindow *wwin; - - WMWindow *win; - - WMLabel *gstepL; - WMLabel *textL; -} GNUstepPanel; - -static GNUstepPanel *gnustepPanel = NULL; - -static void destroyGNUstepPanel(WCoreWindow * foo, void *data, XEvent * event) -{ - WMUnmapWidget(gnustepPanel->win); - - WMDestroyWidget(gnustepPanel->win); - - wUnmanageWindow(gnustepPanel->wwin, False, False); - - wfree(gnustepPanel); - - gnustepPanel = NULL; -} - -void wShowGNUstepPanel(WScreen * scr) -{ - GNUstepPanel *panel; - Window parent; - WWindow *wwin; - WMPixmap *pixmap; - WMColor *color; - - if (gnustepPanel) { - if (gnustepPanel->scr == scr) { - wRaiseFrame(gnustepPanel->wwin->frame->core); - wSetFocusTo(scr, gnustepPanel->wwin); - } - return; - } - - panel = wmalloc(sizeof(GNUstepPanel)); - - panel->scr = scr; - - panel->win = WMCreateWindow(scr->wmscreen, "About GNUstep"); - WMResizeWidget(panel->win, 325, 205); - - pixmap = WMCreatePixmap(scr->wmscreen, 130, 130, WMScreenDepth(scr->wmscreen), True); - - color = WMCreateNamedColor(scr->wmscreen, "gray50", True); - - drawGNUstepLogo(dpy, WMGetPixmapXID(pixmap), 130, 130, WMColorPixel(color), scr->white_pixel); - - WMReleaseColor(color); - - XSetForeground(dpy, scr->mono_gc, 0); - XFillRectangle(dpy, WMGetPixmapMaskXID(pixmap), scr->mono_gc, 0, 0, 130, 130); - drawGNUstepLogo(dpy, WMGetPixmapMaskXID(pixmap), 130, 130, 1, 1); - - panel->gstepL = WMCreateLabel(panel->win); - WMResizeWidget(panel->gstepL, 285, 64); - WMMoveWidget(panel->gstepL, 20, 0); - WMSetLabelTextAlignment(panel->gstepL, WARight); - WMSetLabelText(panel->gstepL, "GNUstep"); - { - WMFont *font = WMBoldSystemFontOfSize(scr->wmscreen, 24); - - WMSetLabelFont(panel->gstepL, font); - WMReleaseFont(font); - } - - panel->textL = WMCreateLabel(panel->win); - WMResizeWidget(panel->textL, 305, 140); - WMMoveWidget(panel->textL, 10, 50); - WMSetLabelTextAlignment(panel->textL, WARight); - WMSetLabelImagePosition(panel->textL, WIPOverlaps); - WMSetLabelText(panel->textL, - _("Window Maker is part of the GNUstep project.\n" - "The GNUstep project aims to create a free\n" - "implementation of the OpenStep(tm) specification\n" - "which is a object-oriented framework for\n" - "creating advanced graphical, multi-platform\n" - "applications. Additionally, a development and\n" - "user desktop environment will be created on top\n" - "of the framework. For more information about\n" - "GNUstep, please visit: www.gnustep.org")); - WMSetLabelImage(panel->textL, pixmap); - - WMReleasePixmap(pixmap); - - WMRealizeWidget(panel->win); - WMMapSubwidgets(panel->win); - - parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 325, 200, 0, 0, 0); - - XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0); - - { - WMPoint center = getCenter(scr, 325, 200); - - wwin = wManageInternalWindow(scr, parent, None, _("About GNUstep"), center.x, center.y, 325, 200); - } - - WSETUFLAG(wwin, no_closable, 0); - WSETUFLAG(wwin, no_close_button, 0); - wWindowUpdateButtonImages(wwin); - wFrameWindowShowButton(wwin->frame, WFF_RIGHT_BUTTON); -#ifdef XKB_BUTTON_HINT - wFrameWindowHideButton(wwin->frame, WFF_LANGUAGE_BUTTON); -#endif - wwin->frame->on_click_right = destroyGNUstepPanel; - - panel->wwin = wwin; - - WMMapWidget(panel->win); - - wWindowMap(wwin); - - gnustepPanel = panel; -} diff --git a/src/dialog.h b/src/dialog.h index dc4639a1..530bd267 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -41,11 +41,7 @@ int wExitDialog(WScreen *scr, char *title, char *message, char *defBtn, Bool wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class); void wShowInfoPanel(WScreen *scr); - void wShowLegalPanel(WScreen *scr); - -void wShowGNUstepPanel(WScreen *scr); - int wShowCrashingDialogPanel(int whatSig); diff --git a/src/dock.c b/src/dock.c index 8a1a21f1..71bef02d 100644 --- a/src/dock.c +++ b/src/dock.c @@ -3281,11 +3281,8 @@ static void iconDblClick(WObjDescriptor *desc, XEvent *event) else handleClipChangeWorkspace(dock->screen_ptr, event); } else if (btn->command) { - if (!btn->launching && (!btn->running || (event->xbutton.state & ControlMask))) { + if (!btn->launching && (!btn->running || (event->xbutton.state & ControlMask))) launchDockedApplication(btn, False); - } - } else if (btn->xindex == 0 && btn->yindex == 0 && btn->dock->type == WM_DOCK) { - wShowGNUstepPanel(dock->screen_ptr); } } } -- 2.11.4.GIT