#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Fri, 27 Apr 2018 13:42:06 +0200
changeset 8348 38903c316df6
parent 8347 33f968a33916
child 8349 1a56a0337599
#REFACTORING by stefan class: XWorkstation changed: class definition #getClipboardObjectFor: #getClipboardText:for:
XWorkstation.st
--- a/XWorkstation.st	Fri Apr 27 12:21:31 2018 +0200
+++ b/XWorkstation.st	Fri Apr 27 13:42:06 2018 +0200
@@ -27,12 +27,12 @@
 		rgbaVisual virtualRootId rootId altModifierMask metaModifierMask
 		lastEventTime rawMonitorBounds monitorBounds lastButtonPressTime
 		lastButtonPressPosition deviceIOTimeoutErrorSignal
-		activateOnClick rawKeySymTranslation selectionOwner
-		clipboardSelectionTime primarySelectionTime selectionFetchers
-		selectionHandlers preWaitAction xlibTimeout
-		xlibTimeoutForWindowCreation hasConnectionBroken uniqueDeviceID
-		stxDeviceAtom uuidAtom primaryBuffer windowGroupWindow
-		maxOperationsUntilFlush operationsUntilFlush lastError'
+		activateOnClick rawKeySymTranslation clipboardSelectionTime
+		primarySelectionTime selectionFetchers selectionHandlers
+		preWaitAction xlibTimeout xlibTimeoutForWindowCreation
+		hasConnectionBroken uniqueDeviceID stxDeviceAtom uuidAtom
+		primaryBuffer windowGroupWindow maxOperationsUntilFlush
+		operationsUntilFlush lastError'
 	classVariableNames:'RawKeySymTranslation ConservativeSync MaxStringLength
 		DefaultXLibTimeout DefaultXLibTimeoutForWindowCreation
 		ErrorDBCache'
@@ -1577,52 +1577,52 @@
 %{
 #ifdef XINERAMA
     if (ISCONNECTED && __INST(hasXineramaExtension) == true) {
-        Display *dpy = myDpy;
-        XineramaScreenInfo *screenInfo;
-        int numDisplays;
-        OBJ *cResultArray;
-        int i, ci;
-
-        screenInfo = XineramaQueryScreens (dpy, &numDisplays);
-        if (screenInfo == 0) {
-            goto out;
-        }
-
-        numberOfMonitors = __mkSmallInteger(numDisplays);
-        resultArray = __ARRAY_NEW_INT(numDisplays * 5);
-        cResultArray = __ArrayInstPtr(resultArray)->a_element;
-
-        for (i=0, ci=0; i < numDisplays; i++, ci+=5) {
-            cResultArray[ci] = __mkSmallInteger(screenInfo[i].screen_number);
-            cResultArray[ci+1] = __mkSmallInteger(screenInfo[i].x_org);
-            cResultArray[ci+2] = __mkSmallInteger(screenInfo[i].y_org);
-            cResultArray[ci+3] = __mkSmallInteger(screenInfo[i].width);
-            cResultArray[ci+4] = __mkSmallInteger(screenInfo[i].height);
-        }
-
-        XFree(screenInfo);
+	Display *dpy = myDpy;
+	XineramaScreenInfo *screenInfo;
+	int numDisplays;
+	OBJ *cResultArray;
+	int i, ci;
+
+	screenInfo = XineramaQueryScreens (dpy, &numDisplays);
+	if (screenInfo == 0) {
+	    goto out;
+	}
+
+	numberOfMonitors = __mkSmallInteger(numDisplays);
+	resultArray = __ARRAY_NEW_INT(numDisplays * 5);
+	cResultArray = __ArrayInstPtr(resultArray)->a_element;
+
+	for (i=0, ci=0; i < numDisplays; i++, ci+=5) {
+	    cResultArray[ci] = __mkSmallInteger(screenInfo[i].screen_number);
+	    cResultArray[ci+1] = __mkSmallInteger(screenInfo[i].x_org);
+	    cResultArray[ci+2] = __mkSmallInteger(screenInfo[i].y_org);
+	    cResultArray[ci+3] = __mkSmallInteger(screenInfo[i].width);
+	    cResultArray[ci+4] = __mkSmallInteger(screenInfo[i].height);
+	}
+
+	XFree(screenInfo);
     }
 #endif
 out:;
 %}.
     numberOfMonitors isNil ifTrue:[
-        "no xinerama - the display is the only monitor"
-        ^ Array with:self bounds.
+	"no xinerama - the display is the only monitor"
+	^ Array with:self bounds.
     ].
     rawMonitorBounds = resultArray ifTrue:[
-        ^ monitorBounds.
+	^ monitorBounds.
     ].
 
     bounds := Array new:numberOfMonitors.
     1 to:numberOfMonitors do:[:idx|
-        |rect baseIdx|
-        baseIdx := (idx-1) * 5.
-        rect := Rectangle
-                    left:(resultArray at:baseIdx+2)
-                    top:(resultArray at:baseIdx+3)
-                    width:(resultArray at:baseIdx+4)
-                    height:(resultArray at:baseIdx+5).
-        bounds at:idx put:rect.
+	|rect baseIdx|
+	baseIdx := (idx-1) * 5.
+	rect := Rectangle
+		    left:(resultArray at:baseIdx+2)
+		    top:(resultArray at:baseIdx+3)
+		    width:(resultArray at:baseIdx+4)
+		    height:(resultArray at:baseIdx+5).
+	bounds at:idx put:rect.
     ].
 
     rawMonitorBounds := resultArray.
@@ -2104,18 +2104,18 @@
 !
 
 createWindowFor:aView type:typeSymbol
-                 origin:origin
-                 extent:extent
-                 minExtent:minExt
-                 maxExtent:maxExt
-                 borderWidth:bWidth
-                 subViewOf:wsuperView
-                 style:wStyle
-                 inputOnly:winputOnly
-                 label:wlabel
-                 owner:wowner
-                 icon:wicon iconMask:wiconMask
-                 iconView:wiconView
+		 origin:origin
+		 extent:extent
+		 minExtent:minExt
+		 maxExtent:maxExt
+		 borderWidth:bWidth
+		 subViewOf:wsuperView
+		 style:wStyle
+		 inputOnly:winputOnly
+		 label:wlabel
+		 owner:wowner
+		 icon:wicon iconMask:wiconMask
+		 iconView:wiconView
 
     <context: #return>
 
@@ -2126,46 +2126,46 @@
      wiconId wiconMaskId wiconViewId windowGroupWindowId|
 
     self isOpen ifFalse:[
-        self primitiveFailedOrClosedConnection.
-        ^ nil
+	self primitiveFailedOrClosedConnection.
+	^ nil
     ].
 
     origin notNil ifTrue:[
-        xpos := origin x.
-        ypos := origin y.
+	xpos := origin x.
+	ypos := origin y.
     ].
     extent notNil ifTrue:[
-        wwidth := extent x.
-        wheight := extent y.
+	wwidth := extent x.
+	wheight := extent y.
     ].
     minExt notNil ifTrue:[
-        minWidth := minExt x.
-        minHeight := minExt y
+	minWidth := minExt x.
+	minHeight := minExt y
     ].
     maxExt notNil ifTrue:[
-        maxWidth := maxExt x.
-        maxHeight := maxExt y
+	maxWidth := maxExt x.
+	maxHeight := maxExt y
     ].
 
     wsuperView notNil ifTrue:[
-        wsuperViewId := wsuperView drawableId.
+	wsuperViewId := wsuperView drawableId.
     ] ifFalse:[
-        isTopWindow := true.
-        aView class ~~ WindowGroupWindow ifTrue:[
-            windowGroupWindow isNil ifTrue:[
-                self getWindowGroupWindow.
-            ].
-            windowGroupWindowId := windowGroupWindow drawableId.
-        ].
-        wicon notNil ifTrue:[
-            wiconId := wicon drawableId.
-            wiconMask notNil ifTrue:[
-                wiconMaskId := wiconMask drawableId.
-            ]
-        ].
-        wiconView notNil ifTrue:[
-            wiconViewId := wiconView drawableId.
-        ].
+	isTopWindow := true.
+	aView class ~~ WindowGroupWindow ifTrue:[
+	    windowGroupWindow isNil ifTrue:[
+		self getWindowGroupWindow.
+	    ].
+	    windowGroupWindowId := windowGroupWindow drawableId.
+	].
+	wicon notNil ifTrue:[
+	    wiconId := wicon drawableId.
+	    wiconMask notNil ifTrue:[
+		wiconMaskId := wiconMask drawableId.
+	    ]
+	].
+	wiconView notNil ifTrue:[
+	    wiconViewId := wiconView drawableId.
+	].
     ].
 
     weventMask := aView eventMask.
@@ -2199,122 +2199,122 @@
     sizehints.y = 0;
 
     if (__bothSmallInteger(wwidth, wheight)) {
-        sizehints.flags |= PSize;
-        sizehints.width = __intVal(wwidth);
-        sizehints.height = __intVal(wheight);
+	sizehints.flags |= PSize;
+	sizehints.width = __intVal(wwidth);
+	sizehints.height = __intVal(wheight);
     }
     if (__bothSmallInteger(xpos, ypos)) {
-        sizehints.flags |= PPosition;
-        sizehints.x = __intVal(xpos);
-        sizehints.y = __intVal(ypos);
+	sizehints.flags |= PPosition;
+	sizehints.x = __intVal(xpos);
+	sizehints.y = __intVal(ypos);
     }
     if (__bothSmallInteger(minWidth, minHeight)) {
-        sizehints.flags |= PMinSize;
-        sizehints.min_width = __intVal(minWidth);
-        sizehints.min_height = __intVal(minHeight);
+	sizehints.flags |= PMinSize;
+	sizehints.min_width = __intVal(minWidth);
+	sizehints.min_height = __intVal(minHeight);
     }
     if (__bothSmallInteger(maxWidth, maxHeight)) {
-        sizehints.flags |= PMaxSize;
-        sizehints.max_width = __intVal(maxWidth);
-        sizehints.max_height = __intVal(maxHeight);
+	sizehints.flags |= PMaxSize;
+	sizehints.max_width = __intVal(maxWidth);
+	sizehints.max_height = __intVal(maxHeight);
     }
 
     bg = WhitePixel(dpy, screen);
 
     if (__isSmallInteger(bWidth)) {
-        bw = __intVal(bWidth);
+	bw = __intVal(bWidth);
     } else {
-        bw = 0;
+	bw = 0;
     }
 
     bd = BlackPixel(dpy, screen);
 
     if (__isExternalAddress(wsuperViewId)) {
-        parentWindow = __WindowVal(wsuperViewId);
+	parentWindow = __WindowVal(wsuperViewId);
     } else {
-        parentWindow = RootWindow(dpy, screen);
+	parentWindow = RootWindow(dpy, screen);
     }
 
     if (wStyle == @symbol(popUp))
-        xswa.override_redirect = 1;
+	xswa.override_redirect = 1;
     else
-        xswa.override_redirect = 0;
+	xswa.override_redirect = 0;
 
     if (winputOnly == true)
-        ioClass = InputOnly;
+	ioClass = InputOnly;
     else
-        ioClass = InputOutput;
+	ioClass = InputOutput;
 
     if (__isSmallInteger(weventMask)) {
-        xswa.event_mask = __intVal(weventMask);
+	xswa.event_mask = __intVal(weventMask);
     } else {
-        xswa.event_mask = 0;
+	xswa.event_mask = 0;
     }
 
     if (ioClass == InputOnly) {
-        bw = 0;
-        depth = 0;
-        flags |= CWEventMask;
+	bw = 0;
+	depth = 0;
+	flags |= CWEventMask;
     } else {
-        depth = DefaultDepth(dpy,screen);
-        flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
-
-        if (backPixmap != (Pixmap)0) {
-            xswa.background_pixmap = backPixmap;
-            flags |= CWBackPixmap;
-        } else {
-            xswa.background_pixel = bg;
-            flags |= CWBackPixel;
-        }
-        xswa.border_pixel = bd;
+	depth = DefaultDepth(dpy,screen);
+	flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
+
+	if (backPixmap != (Pixmap)0) {
+	    xswa.background_pixmap = backPixmap;
+	    flags |= CWBackPixmap;
+	} else {
+	    xswa.background_pixel = bg;
+	    flags |= CWBackPixel;
+	}
+	xswa.border_pixel = bd;
     }
 
     visual.visualid = CopyFromParent;
     if (__isSmallInteger(preferredDepth)) {
-        depth = __intVal(preferredDepth);
+	depth = __intVal(preferredDepth);
     }
 
 
     if (preferredVisual != nil) {
-        XVisualInfo vi;
-        int cls;
-
-        if (preferredVisual == @symbol(StaticGray))
-            cls = StaticGray;
-        else if (preferredVisual == @symbol(GrayScale))
-            cls = GrayScale;
-        else if (preferredVisual == @symbol(StaticColor))
-            cls = StaticColor;
-        else if (preferredVisual == @symbol(PseudoColor))
-            cls = PseudoColor;
-        else if (preferredVisual == @symbol(TrueColor))
-            cls = TrueColor;
-        else if (preferredVisual == @symbol(DirectColor))
-            cls = DirectColor;
-        else
-            cls = PseudoColor;
-
-        ENTER_XLIB();
-        if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
-            visual.visualid = vi.visualid;
+	XVisualInfo vi;
+	int cls;
+
+	if (preferredVisual == @symbol(StaticGray))
+	    cls = StaticGray;
+	else if (preferredVisual == @symbol(GrayScale))
+	    cls = GrayScale;
+	else if (preferredVisual == @symbol(StaticColor))
+	    cls = StaticColor;
+	else if (preferredVisual == @symbol(PseudoColor))
+	    cls = PseudoColor;
+	else if (preferredVisual == @symbol(TrueColor))
+	    cls = TrueColor;
+	else if (preferredVisual == @symbol(DirectColor))
+	    cls = DirectColor;
+	else
+	    cls = PseudoColor;
+
+	ENTER_XLIB();
+	if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
+	    visual.visualid = vi.visualid;
 /*
-            console_fprintf(stderr, "visualId=%x\n", vi.visualid);
+	    console_fprintf(stderr, "visualId=%x\n", vi.visualid);
 */
-        }
-        LEAVE_XLIB();
+	}
+	LEAVE_XLIB();
     }
 
     ENTER_XLIB2();
     newWindow = XCreateWindow(dpy, parentWindow,
-                           sizehints.x, sizehints.y,
-                           sizehints.width, sizehints.height,
-                           bw, depth, ioClass, &visual,
-                           flags, &xswa);
+			   sizehints.x, sizehints.y,
+			   sizehints.width, sizehints.height,
+			   bw, depth, ioClass, &visual,
+			   flags, &xswa);
     LEAVE_XLIB();
 
 
     if (! newWindow) {
-        RETURN ( nil );
+	RETURN ( nil );
     }
 
 #ifdef COUNT_RESOURCES
@@ -2326,168 +2326,168 @@
      * (only makes sense for topWindows)
      */
     if (isTopWindow == true) {
-        XWMHints wmhints;
-
-        wmhints.flags = 0;
-
-        if (__isExternalAddress(wiconId)) {
-            wmhints.icon_pixmap = __PixmapVal(wiconId);
-            wmhints.flags = IconPixmapHint;
-            if (__isExternalAddress(wiconMaskId)) {
-                wmhints.icon_mask = __PixmapVal(wiconMaskId);
-                wmhints.flags |= IconMaskHint;
-            }
-        }
-
-        if (__isExternalAddress(windowGroupWindowId)) {
-            wmhints.window_group = __WindowVal(windowGroupWindowId);
-            wmhints.flags |= WindowGroupHint;
-        }
-
-        if (__isExternalAddress(wiconViewId)) {
-            wmhints.flags |= IconWindowHint;
-            wmhints.icon_window = __WindowVal(wiconViewId);
-        };
+	XWMHints wmhints;
+
+	wmhints.flags = 0;
+
+	if (__isExternalAddress(wiconId)) {
+	    wmhints.icon_pixmap = __PixmapVal(wiconId);
+	    wmhints.flags = IconPixmapHint;
+	    if (__isExternalAddress(wiconMaskId)) {
+		wmhints.icon_mask = __PixmapVal(wiconMaskId);
+		wmhints.flags |= IconMaskHint;
+	    }
+	}
+
+	if (__isExternalAddress(windowGroupWindowId)) {
+	    wmhints.window_group = __WindowVal(windowGroupWindowId);
+	    wmhints.flags |= WindowGroupHint;
+	}
+
+	if (__isExternalAddress(wiconViewId)) {
+	    wmhints.flags |= IconWindowHint;
+	    wmhints.icon_window = __WindowVal(wiconViewId);
+	};
 
 /*
-        wmhints.flags |= InputHint;
-        wmhints.input = True;
+	wmhints.flags |= InputHint;
+	wmhints.input = True;
 */
-        ENTER_XLIB();
-        XSetWMHints(dpy, newWindow, &wmhints);
-        XSetWMNormalHints(dpy, newWindow, &sizehints);
-        LEAVE_XLIB();
-
-        /*
-         * get atoms first (if not already known)
-         */
-        if (__INST(protocolsAtom) == nil) {
-            ENTER_XLIB();
-            WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
-            __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
+	ENTER_XLIB();
+	XSetWMHints(dpy, newWindow, &wmhints);
+	XSetWMNormalHints(dpy, newWindow, &sizehints);
+	LEAVE_XLIB();
+
+	/*
+	 * get atoms first (if not already known)
+	 */
+	if (__INST(protocolsAtom) == nil) {
+	    ENTER_XLIB();
+	    WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
+	    __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
 #ifdef USE_SAVEYOURSELF_ATOM
-            WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
-            __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
+	    WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
+	    __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
 #endif
 #ifdef USE_QUIT_APP_ATOM
-            WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
-            __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
-#endif
-            WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-            __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
-
-            UUIDAtom = XInternAtom(dpy, "UUID", False);
-            __INST(uuidAtom) = __MKATOMOBJ(UUIDAtom);
-            STXDeviceAtom = XInternAtom(dpy, "STX_DEVICE_ID", False);
-            __INST(stxDeviceAtom) = __MKATOMOBJ(STXDeviceAtom);
-
-            LEAVE_XLIB();
-        } else {
+	    WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
+	    __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
+#endif
+	    WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+	    __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
+
+	    UUIDAtom = XInternAtom(dpy, "UUID", False);
+	    __INST(uuidAtom) = __MKATOMOBJ(UUIDAtom);
+	    STXDeviceAtom = XInternAtom(dpy, "STX_DEVICE_ID", False);
+	    __INST(stxDeviceAtom) = __MKATOMOBJ(STXDeviceAtom);
+
+	    LEAVE_XLIB();
+	} else {
 #ifdef USE_QUIT_APP_ATOM
-            WmQuitAppAtom = __AtomVal(__INST(quitAppAtom));
+	    WmQuitAppAtom = __AtomVal(__INST(quitAppAtom));
 #else
-            WmQuitAppAtom = 0;
-#endif
-            WmProtocolsAtom = __AtomVal(__INST(protocolsAtom));
-            WmDeleteWindowAtom = __AtomVal(__INST(deleteWindowAtom));
+	    WmQuitAppAtom = 0;
+#endif
+	    WmProtocolsAtom = __AtomVal(__INST(protocolsAtom));
+	    WmDeleteWindowAtom = __AtomVal(__INST(deleteWindowAtom));
 #ifdef USE_SAVEYOURSELF_ATOM
-            WmSaveYourselfAtom = __AtomVal(__INST(saveYourselfAtom));
+	    WmSaveYourselfAtom = __AtomVal(__INST(saveYourselfAtom));
 #else
-            WmSaveYourselfAtom = 0;
-#endif
-            UUIDAtom = __AtomVal(__INST(uuidAtom));;
-            STXDeviceAtom = __AtomVal(__INST(stxDeviceAtom));;
-        }
-
-        /*
-         * tell window manager to not kill us but send an event instead
-         */
-        atoms[0] = WmDeleteWindowAtom; atomCount++;
+	    WmSaveYourselfAtom = 0;
+#endif
+	    UUIDAtom = __AtomVal(__INST(uuidAtom));;
+	    STXDeviceAtom = __AtomVal(__INST(stxDeviceAtom));;
+	}
+
+	/*
+	 * tell window manager to not kill us but send an event instead
+	 */
+	atoms[0] = WmDeleteWindowAtom; atomCount++;
 #ifdef USE_SAVEYOURSELF_ATOM
-        atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
+	atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
 #endif
 #ifdef USE_QUIT_APP_ATOM
-        atoms[atomCount] = WmQuitAppAtom; atomCount++;
-#endif
-        ENTER_XLIB();
-        XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
-                        32, PropModeReplace, (unsigned char *)atoms, atomCount);
-        LEAVE_XLIB();
-
-        /*
-         * an optional unique id (to mark stx-windows)
-         */
-        if (__isBytes(__INST(uniqueDeviceID))) {
-            int numUUIDBytes = __byteArraySize(__INST(uniqueDeviceID));
-            unsigned char uuidBytes[32];
-
-            if (numUUIDBytes <= sizeof(uuidBytes)) {
-                Atom uuidAtom;
-
-                bcopy(__byteArrayVal(__INST(uniqueDeviceID)), uuidBytes, numUUIDBytes);
-
-                ENTER_XLIB();
-                XChangeProperty (dpy, newWindow, STXDeviceAtom, UUIDAtom, 8, PropModeReplace,
-                                 uuidBytes, numUUIDBytes );
-                LEAVE_XLIB();
-            }
-        }
+	atoms[atomCount] = WmQuitAppAtom; atomCount++;
+#endif
+	ENTER_XLIB();
+	XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
+			32, PropModeReplace, (unsigned char *)atoms, atomCount);
+	LEAVE_XLIB();
+
+	/*
+	 * an optional unique id (to mark stx-windows)
+	 */
+	if (__isBytes(__INST(uniqueDeviceID))) {
+	    int numUUIDBytes = __byteArraySize(__INST(uniqueDeviceID));
+	    unsigned char uuidBytes[32];
+
+	    if (numUUIDBytes <= sizeof(uuidBytes)) {
+		Atom uuidAtom;
+
+		bcopy(__byteArrayVal(__INST(uniqueDeviceID)), uuidBytes, numUUIDBytes);
+
+		ENTER_XLIB();
+		XChangeProperty (dpy, newWindow, STXDeviceAtom, UUIDAtom, 8, PropModeReplace,
+				 uuidBytes, numUUIDBytes );
+		LEAVE_XLIB();
+	    }
+	}
 
 #ifdef SUPPORT_MOTIF_WM_HINTS
-        /*
-         * less decoration
-         */
-        if ((wStyle == @symbol(undecorated))
-         || (wStyle == @symbol(dialog2))
-         || (wStyle == @symbol(notitle))
-        ) {
-            if (__INST(motifWMHintsAtom) == nil) {
-                ENTER_XLIB();
-                MotifWMHintsAtom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
-                __INST(motifWMHintsAtom) = __MKATOMOBJ(MotifWMHintsAtom);
-                LEAVE_XLIB();
-            } else {
-                MotifWMHintsAtom = __AtomVal(__INST(motifWMHintsAtom));
-            }
-
-            {
-                struct hints {
-                    unsigned long flags;
-                    unsigned long functions;
-                    unsigned long decorations;
-                    long input_mode;
-                    unsigned long status;
-                } mvm_hints;
-
-                if (wStyle == @symbol(undecorated)) {
-                    mvm_hints.decorations = MWM_DECOR_NONE;
-                }
-                if (wStyle == @symbol(dialog2)) {
-                    mvm_hints.decorations = MWM_DECOR_BORDER
-                                            | MWM_DECOR_RESIZEH
-                                            | MWM_DECOR_TITLE
-                                            /* | MWM_DECOR_MENU */
-                                            /* | MWM_DECOR_MINIMIZE */
-                                            /* | MWM_DECOR_MAXIMIZE */
-                                            ;
-                }
-                if (wStyle == @symbol(notitle)) {
-                    mvm_hints.decorations = MWM_DECOR_BORDER
-                                            /* | MWM_DECOR_RESIZEH  */
-                                            /* | MWM_DECOR_TITLE    */
-                                            /* | MWM_DECOR_MENU     */
-                                            /* | MWM_DECOR_MINIMIZE */
-                                            /* | MWM_DECOR_MAXIMIZE */
-                                            ;
-                }
-                mvm_hints.flags =  MWM_HINTS_DECORATIONS;
-                ENTER_XLIB();
-                XChangeProperty (dpy, newWindow, MotifWMHintsAtom,
-                                     MotifWMHintsAtom, 32, PropModeReplace,
-                                     (unsigned char*)&mvm_hints, 5 );
-                LEAVE_XLIB();
-            }
-        }
+	/*
+	 * less decoration
+	 */
+	if ((wStyle == @symbol(undecorated))
+	 || (wStyle == @symbol(dialog2))
+	 || (wStyle == @symbol(notitle))
+	) {
+	    if (__INST(motifWMHintsAtom) == nil) {
+		ENTER_XLIB();
+		MotifWMHintsAtom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False);
+		__INST(motifWMHintsAtom) = __MKATOMOBJ(MotifWMHintsAtom);
+		LEAVE_XLIB();
+	    } else {
+		MotifWMHintsAtom = __AtomVal(__INST(motifWMHintsAtom));
+	    }
+
+	    {
+		struct hints {
+		    unsigned long flags;
+		    unsigned long functions;
+		    unsigned long decorations;
+		    long input_mode;
+		    unsigned long status;
+		} mvm_hints;
+
+		if (wStyle == @symbol(undecorated)) {
+		    mvm_hints.decorations = MWM_DECOR_NONE;
+		}
+		if (wStyle == @symbol(dialog2)) {
+		    mvm_hints.decorations = MWM_DECOR_BORDER
+					    | MWM_DECOR_RESIZEH
+					    | MWM_DECOR_TITLE
+					    /* | MWM_DECOR_MENU */
+					    /* | MWM_DECOR_MINIMIZE */
+					    /* | MWM_DECOR_MAXIMIZE */
+					    ;
+		}
+		if (wStyle == @symbol(notitle)) {
+		    mvm_hints.decorations = MWM_DECOR_BORDER
+					    /* | MWM_DECOR_RESIZEH  */
+					    /* | MWM_DECOR_TITLE    */
+					    /* | MWM_DECOR_MENU     */
+					    /* | MWM_DECOR_MINIMIZE */
+					    /* | MWM_DECOR_MAXIMIZE */
+					    ;
+		}
+		mvm_hints.flags =  MWM_HINTS_DECORATIONS;
+		ENTER_XLIB();
+		XChangeProperty (dpy, newWindow, MotifWMHintsAtom,
+				     MotifWMHintsAtom, 32, PropModeReplace,
+				     (unsigned char*)&mvm_hints, 5 );
+		LEAVE_XLIB();
+	    }
+	}
 #endif /* SUPPORT_MOTIF_WM_HINTS */
     }
 
@@ -2500,9 +2500,9 @@
 
     (wsuperView isNil "this is a topwindow"
      and:[wlabel notEmptyOrNil]) ifTrue:[
-        self
-            setIconName:wlabel in:windowId;
-            setWindowName:wlabel in:windowId.
+	self
+	    setIconName:wlabel in:windowId;
+	    setWindowName:wlabel in:windowId.
     ].
 
     self addKnownView:aView withId:windowId.
@@ -2817,14 +2817,14 @@
 
     s := aString ? ''.
     s isString ifFalse:[
-        s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false
+	s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false
     ].
 
     viewID := aView drawableId.
     viewID notNil ifTrue:[ "/ if the view is not already closed
-        "/ for now - should add support to pass emphasis information too
-        s := s string.
-        self setPrimaryText:s owner:viewID.
+	"/ for now - should add support to pass emphasis information too
+	s := s string.
+	self setPrimaryText:s owner:viewID.
     ]
 
     "Created: / 27-03-2012 / 14:46:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -3303,10 +3303,10 @@
     "create a cursor given 2 bitmaps (source, mask) and a hotspot"
 
     ^ self
-        primCreateCursorSourceFormId:sourceForm drawableId
-        maskFormId:maskForm drawableId
-        hotX:hx hotY:hy
-        width:w height:h
+	primCreateCursorSourceFormId:sourceForm drawableId
+	maskFormId:maskForm drawableId
+	hotX:hx hotY:hy
+	width:w height:h
 
     "Modified: / 26-04-2018 / 11:02:52 / stefan"
 !
@@ -3458,128 +3458,128 @@
 
     (msgType := self atomIDOf:#DndProtocol) notNil ifTrue:[
 
-        "/ DND can drop files, file, dir, links, dirLink and text
-        "/ check for this.
-
-        dropObjects isCollection ifFalse:[
-            dropColl := Array with:dropObjects
-        ] ifTrue:[
-            dropColl := dropObjects
-        ].
-        anyFile := anyDir := anyText := anyOther := false.
-        dropColl do:[:aDropObject |
-            aDropObject isFileObject ifTrue:[
-                aDropObject theObject isDirectory ifTrue:[
-                    anyDir := true
-                ] ifFalse:[
-                    anyFile := true
-                ]
-            ] ifFalse:[
-                aDropObject isTextObject ifTrue:[
-                    anyText := true
-                ] ifFalse:[
-                    anyOther := true
-                ]
-            ]
-        ].
-
-        anyOther ifTrue:[
-            "/ DND does not support this ...
-            Logger info:'DND can only drop files or text'.
-            ^ false
-        ].
-        anyText ifTrue:[
-            (anyFile or:[anyDir]) ifTrue:[
-                "/ DND does not support mixed types
-                Logger info:'DND cannot drop both files and text'.
-                ^ false
-            ]
-        ].
-
-        dropCollSize := dropColl size.
-        anyFile ifTrue:[
-            dropType := #DndFiles.
-            dropCollSize == 1 ifTrue:[
-                dropType := #DndFile
-            ]
-        ] ifFalse:[
-            anyDir ifTrue:[
-                dropType := #DndFiles.
-                dropCollSize == 1 ifTrue:[
-                    dropType := #DndDir
-                ]
-            ] ifFalse:[
-                anyText ifTrue:[
-                    dropCollSize == 1 ifTrue:[
-                        dropType := #DndText
-                    ] ifFalse:[
-                        "/ can only drop a single text object
-                        Logger info:'DND can only drop a single text'.
-                        ^ false
-                    ]
-                ] ifFalse:[
-                    "/ mhmh ...
-                    Logger info:'DND cannot drop this'.
-                    ^ false
-                ]
-            ]
-        ].
-
-        dropTypeCode := self dndDropTypes indexOf:dropType.
-        dropTypeCode == 0 ifTrue:[
-            Logger info:'DND cannot drop this'.
-            ^ false
-        ].
-        dropTypeCode := dropTypeCode - 1.
-
-
-        "/ place the selection inTo the DndSelection property
-        "/ of the rootView ...
-        "/ ... need a single string, with 0-terminated parts.
-
-        strings := OrderedCollection new.
-        sz := 0.
-        dropColl do:[:anObject |
-            |s o|
-
-            o := anObject theObject.
-            anObject isFileObject ifTrue:[
-                o := o pathName
-            ].
-            s := o asString.
-            strings add:s.
-            sz := sz + (s size) + 1.
-        ].
-        val := String new:sz.
-        idx := 1.
-        strings do:[:aString |
-            |sz|
-
-            sz := aString size.
-            val replaceFrom:idx to:(idx + sz - 1) with:aString startingAt:1.
-            idx := idx + sz.
-            val at:idx put:(Character value:0).
-            idx := idx + 1
-        ].
-
-        self
-            setProperty:#DndSelection
-            type:#STRING
-            value:val
-            for:rootId.
-
-        ^ self
-            sendClientEvent:msgType
-            format:32
-            to:destinationId
-            propagate:true
-            eventMask:nil
-            window:destinationId
-            data1:dropTypeCode
-            data2:0
-            data3:destinationId
-            data4:nil
-            data5:nil.
+	"/ DND can drop files, file, dir, links, dirLink and text
+	"/ check for this.
+
+	dropObjects isCollection ifFalse:[
+	    dropColl := Array with:dropObjects
+	] ifTrue:[
+	    dropColl := dropObjects
+	].
+	anyFile := anyDir := anyText := anyOther := false.
+	dropColl do:[:aDropObject |
+	    aDropObject isFileObject ifTrue:[
+		aDropObject theObject isDirectory ifTrue:[
+		    anyDir := true
+		] ifFalse:[
+		    anyFile := true
+		]
+	    ] ifFalse:[
+		aDropObject isTextObject ifTrue:[
+		    anyText := true
+		] ifFalse:[
+		    anyOther := true
+		]
+	    ]
+	].
+
+	anyOther ifTrue:[
+	    "/ DND does not support this ...
+	    Logger info:'DND can only drop files or text'.
+	    ^ false
+	].
+	anyText ifTrue:[
+	    (anyFile or:[anyDir]) ifTrue:[
+		"/ DND does not support mixed types
+		Logger info:'DND cannot drop both files and text'.
+		^ false
+	    ]
+	].
+
+	dropCollSize := dropColl size.
+	anyFile ifTrue:[
+	    dropType := #DndFiles.
+	    dropCollSize == 1 ifTrue:[
+		dropType := #DndFile
+	    ]
+	] ifFalse:[
+	    anyDir ifTrue:[
+		dropType := #DndFiles.
+		dropCollSize == 1 ifTrue:[
+		    dropType := #DndDir
+		]
+	    ] ifFalse:[
+		anyText ifTrue:[
+		    dropCollSize == 1 ifTrue:[
+			dropType := #DndText
+		    ] ifFalse:[
+			"/ can only drop a single text object
+			Logger info:'DND can only drop a single text'.
+			^ false
+		    ]
+		] ifFalse:[
+		    "/ mhmh ...
+		    Logger info:'DND cannot drop this'.
+		    ^ false
+		]
+	    ]
+	].
+
+	dropTypeCode := self dndDropTypes indexOf:dropType.
+	dropTypeCode == 0 ifTrue:[
+	    Logger info:'DND cannot drop this'.
+	    ^ false
+	].
+	dropTypeCode := dropTypeCode - 1.
+
+
+	"/ place the selection inTo the DndSelection property
+	"/ of the rootView ...
+	"/ ... need a single string, with 0-terminated parts.
+
+	strings := OrderedCollection new.
+	sz := 0.
+	dropColl do:[:anObject |
+	    |s o|
+
+	    o := anObject theObject.
+	    anObject isFileObject ifTrue:[
+		o := o pathName
+	    ].
+	    s := o asString.
+	    strings add:s.
+	    sz := sz + (s size) + 1.
+	].
+	val := String new:sz.
+	idx := 1.
+	strings do:[:aString |
+	    |sz|
+
+	    sz := aString size.
+	    val replaceFrom:idx to:(idx + sz - 1) with:aString startingAt:1.
+	    idx := idx + sz.
+	    val at:idx put:(Character value:0).
+	    idx := idx + 1
+	].
+
+	self
+	    setProperty:#DndSelection
+	    type:#STRING
+	    value:val
+	    for:rootId.
+
+	^ self
+	    sendClientEvent:msgType
+	    format:32
+	    to:destinationId
+	    propagate:true
+	    eventMask:nil
+	    window:destinationId
+	    data1:dropTypeCode
+	    data2:0
+	    data3:destinationId
+	    data4:nil
+	    data5:nil.
     ].
 
     ^ false
@@ -5330,9 +5330,9 @@
     dropType := (self dndDropTypes) at:dropType+1 ifAbsent:#DndNotDnd.
 
     property := self
-                    getProperty:#DndSelection
-                    from:rootId
-                    delete:false.
+		    getProperty:#DndSelection
+		    from:rootId
+		    delete:false.
 
     propertyType := property key.
     dropValue := property value.
@@ -5346,57 +5346,57 @@
     "/ in the default dropMessage handling of SimpleView.
 
     dropType == #DndFiles ifTrue:[
-        "/ actually, a list of fileNames
-        dropValue firstOrNil isString ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropValue := dropValue collect:[:nm | nm asFilename].
-        dropType := #files.
+	"/ actually, a list of fileNames
+	dropValue firstOrNil isString ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropValue := dropValue collect:[:nm | nm asFilename].
+	dropType := #files.
     ] ifFalse:[ (dropType == #DndFile) ifTrue:[
-        dropValue isString ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropValue := dropValue asFilename.
-        dropType := #file.
+	dropValue isString ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropValue := dropValue asFilename.
+	dropType := #file.
     ] ifFalse:[ (dropType == #DndDir) ifTrue:[
-        dropValue isString ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropValue := dropValue asFilename.
-        dropType := #directory.
+	dropValue isString ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropValue := dropValue asFilename.
+	dropType := #directory.
     ] ifFalse:[ (dropType == #DndText) ifTrue:[
-        (dropValue isString or:[dropValue isStringCollection]) ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropValue := dropValue asString.
-        dropType := #text.
+	(dropValue isString or:[dropValue isStringCollection]) ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropValue := dropValue asString.
+	dropType := #text.
     ] ifFalse:[ (dropType == #DndExe) ifTrue:[
-        dropValue isString ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropType := #executable.
+	dropValue isString ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropType := #executable.
     ] ifFalse:[ (dropType == #DndLink) ifTrue:[
-        dropValue isString ifFalse:[
-            Logger info:'expected a string propertyValue in drop'.
-            ^ self
-        ].
-        dropType := #link.
+	dropValue isString ifFalse:[
+	    Logger info:'expected a string propertyValue in drop'.
+	    ^ self
+	].
+	dropType := #link.
     ] ifFalse:[ (dropType == #DndRawData) ifTrue:[
-        dropType := #rawData.
+	dropType := #rawData.
     ] ifFalse:[
-        Logger info:'unsupported dropType: %1 data: %2 ' with:dropType with:dropValue.
-        dropType := #unknown.
+	Logger info:'unsupported dropType: %1 data: %2 ' with:dropType with:dropValue.
+	dropType := #unknown.
     ]]]]]]].
 
     sensor := targetView sensor.
     "not posted, if there is no sensor ..."
     sensor notNil ifTrue:[
-        sensor dropMessage:dropType data:dropValue view:targetView position:nil handle:nil
+	sensor dropMessage:dropType data:dropValue view:targetView position:nil handle:nil
     ].
 
     "Created: / 04-04-1997 / 17:59:37 / cg"
@@ -5530,8 +5530,8 @@
 
     lastEventTime := time.
     aView isNil ifTrue:[
-        "event arrived, after aView has been destroyed"
-        ^ self
+	"event arrived, after aView has been destroyed"
+	^ self
     ].
 
 "/    'propertyChange ' infoPrint. (self atomName:propertyId) print. ': ' print. aSymbol printCR.
@@ -5543,12 +5543,12 @@
     aView sensor propertyChange:aView property:propertyId state:aSymbol time:time.
 
     aSymbol ~~ #newValue ifTrue:[
-        "I am not interested in delete notifications"
-        ^ self.
+	"I am not interested in delete notifications"
+	^ self.
     ].
     selectionFetcher := self findSelectionFetcher:aView drawableId.
     selectionFetcher notNil ifTrue:[
-        selectionFetcher message:thisContext message.
+	selectionFetcher message:thisContext message.
     ].
 
     "Modified: / 01-06-2011 / 13:40:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -5564,18 +5564,18 @@
     lastEventTime := time.
 
     selectionHandlers notNil ifTrue:[
-        selectionHandlers do:[:eachHandler |
-            eachHandler selectionClear:selectionID
-        ]
+	selectionHandlers do:[:eachHandler |
+	    eachHandler selectionClear:selectionID
+	]
     ].
 
     aView isNil ifTrue:[
-        "event arrived, after aView has been destroyed"
-        ^ self
+	"event arrived, after aView has been destroyed"
+	^ self
     ].
     selectionFetcher := self findSelectionFetcher:aView drawableId.
     selectionFetcher notNil ifTrue:[
-        selectionFetcher message:thisContext message.
+	selectionFetcher message:thisContext message.
     ].
 
     "Modified: / 26-04-2018 / 11:00:30 / stefan"
@@ -5599,12 +5599,12 @@
     lastEventTime := time.
 
     aView isNil ifTrue:[
-        "event arrived, after aView has been destroyed"
-        ^ self
+	"event arrived, after aView has been destroyed"
+	^ self
     ].
     selectionFetcher := self findSelectionFetcher:aView drawableId.
     selectionFetcher notNil ifTrue:[
-        selectionFetcher message:thisContext message.
+	selectionFetcher message:thisContext message.
     ].
 
     "Modified (format): / 14-03-2017 / 16:31:20 / cg"
@@ -9366,29 +9366,29 @@
 
 initializeScreenBounds
     self isOpen ifFalse:[
-        "queries answer nil if not open"
-        ^ self.
+	"queries answer nil if not open"
+	^ self.
     ].
     self isXineramaActive ifTrue:[
-        |rect|
-
-        self monitorBounds do:[:eachRect|
-            rect isNil ifTrue:[
-                rect := eachRect.
-            ] ifFalse:[
-                rect := rect merge:eachRect.
-            ]
-        ].
-        width := rect width.
-        height := rect height.
-
-        "propagate possible size changes to our rootView"
-        rootView notNil ifTrue:[
-            rootView initialize.
-        ].
+	|rect|
+
+	self monitorBounds do:[:eachRect|
+	    rect isNil ifTrue:[
+		rect := eachRect.
+	    ] ifFalse:[
+		rect := rect merge:eachRect.
+	    ]
+	].
+	width := rect width.
+	height := rect height.
+
+	"propagate possible size changes to our rootView"
+	rootView notNil ifTrue:[
+	    rootView initialize.
+	].
     ] ifFalse:[
-        width := self queryWidth.
-        height := self queryHeight.
+	width := self queryWidth.
+	height := self queryHeight.
     ].
     widthMM := self queryWidthMM.
     heightMM := self queryHeightMM.
@@ -10126,8 +10126,8 @@
     "output an audible beep or bell"
 
     UserPreferences current beepEnabled ifTrue:[
-        self beep:0 volume:50.
-        self flush
+	self beep:0 volume:50.
+	self flush
     ]
 
     "
@@ -10635,59 +10635,59 @@
     |val propertyAtomID association windowIDOrNil|
 
     propertySymbolOrAtomID isString ifTrue:[
-        propertyAtomID := self atomIDOf:propertySymbolOrAtomID create:false.
-        propertyAtomID isNil ifTrue:[^ nil].
+	propertyAtomID := self atomIDOf:propertySymbolOrAtomID create:false.
+	propertyAtomID isNil ifTrue:[^ nil].
     ] ifFalse:[
-        propertyAtomID := propertySymbolOrAtomID.
+	propertyAtomID := propertySymbolOrAtomID.
     ].
     aWindowOrWindowIDOrNil isView ifTrue:[
-        windowIDOrNil := aWindowOrWindowIDOrNil drawableId.
+	windowIDOrNil := aWindowOrWindowIDOrNil drawableId.
     ] ifFalse:[
-        windowIDOrNil := aWindowOrWindowIDOrNil.
+	windowIDOrNil := aWindowOrWindowIDOrNil.
     ].
 
     association := self primGetProperty:propertyAtomID from:windowIDOrNil delete:doDelete.
     association isNil ifTrue:[
-        "The property does not exist in the specified window"
-        ^ nil
+	"The property does not exist in the specified window"
+	^ nil
     ].
     val := association value.
     (val isByteArray and:[association key = (self atomIDOf:#'UTF8_STRING' create:true)]) ifTrue:[
-        val := val utf8Decoded.
+	val := val utf8Decoded.
     ].
     (val isString and:[val includes:(Character codePoint:0)]) ifTrue:[
-        val := val asCollectionOfSubCollectionsSeparatedBy:(Character codePoint:0).
-    ]. 
+	val := val asCollectionOfSubCollectionsSeparatedBy:(Character codePoint:0).
+    ].
     association value:val.
     ^ association
 
     "
      Display
-        getProperty:#'_NET_DESKTOP_NAMES'
-        from:nil
-        delete:false
+	getProperty:#'_NET_DESKTOP_NAMES'
+	from:nil
+	delete:false
 
      Display
-        getProperty:#'_NET_CURRENT_DESKTOP'
-        from:nil
-        delete:false
+	getProperty:#'_NET_CURRENT_DESKTOP'
+	from:nil
+	delete:false
 
      Display
-        getProperty:#'_NET_WM_ALLOWED_ACTIONS'
-        from:Transcript
-        delete:false
+	getProperty:#'_NET_WM_ALLOWED_ACTIONS'
+	from:Transcript
+	delete:false
 
      Display
-        getProperty:#'_NET_SUPPORTED'
-        from:nil
-        delete:false
+	getProperty:#'_NET_SUPPORTED'
+	from:nil
+	delete:false
 
      Transcript showCR:(
-         (Display
-            getProperty:#'_NET_SUPPORTED'
-            from:nil
-            delete:false) value
-                    collect:[:eachID | Display atomName:eachID])
+	 (Display
+	    getProperty:#'_NET_SUPPORTED'
+	    from:nil
+	    delete:false) value
+		    collect:[:eachID | Display atomName:eachID])
 
     "
 
@@ -10714,92 +10714,92 @@
 #   define PROP_SIZE    2048
 
     if (ISCONNECTED) {
-        Display *dpy = myDpy;
-
-        if (__isAtomID(propertyAtomID)) {
-            property = __AtomVal(propertyAtomID);
-
-            if (__isExternalAddress(aWindowIDOrNil)) {
-                window = __WindowVal(aWindowIDOrNil);
-            } else if (aWindowIDOrNil == nil) {
-                window = DefaultRootWindow(dpy);
-            } else
-                goto fail;
+	Display *dpy = myDpy;
+
+	if (__isAtomID(propertyAtomID)) {
+	    property = __AtomVal(propertyAtomID);
+
+	    if (__isExternalAddress(aWindowIDOrNil)) {
+		window = __WindowVal(aWindowIDOrNil);
+	    } else if (aWindowIDOrNil == nil) {
+		window = DefaultRootWindow(dpy);
+	    } else
+		goto fail;
 
 #ifdef PROPERTY_DEBUG
-            console_fprintf(stderr, "getProperty %x\n", property);
-#endif
-
-            do {
-                int retVal;
-                unsigned char *data;
-                unsigned long nitems, nReturnedBytes;
-
-                ENTER_XLIB();
-                retVal = XGetWindowProperty(dpy, window, property, nread/4, PROP_SIZE,
-                                            doDelete == true,
-                                            AnyPropertyType, &actual_type, &actual_format,
-                                            &nitems, &bytes_after, (unsigned char **)&data);
-                LEAVE_XLIB();
-                if (retVal != Success) {
+	    console_fprintf(stderr, "getProperty %x\n", property);
+#endif
+
+	    do {
+		int retVal;
+		unsigned char *data;
+		unsigned long nitems, nReturnedBytes;
+
+		ENTER_XLIB();
+		retVal = XGetWindowProperty(dpy, window, property, nread/4, PROP_SIZE,
+					    doDelete == true,
+					    AnyPropertyType, &actual_type, &actual_format,
+					    &nitems, &bytes_after, (unsigned char **)&data);
+		LEAVE_XLIB();
+		if (retVal != Success) {
 #ifdef PROPERTY_DEBUG
-                    console_fprintf(stderr, "- no success\n");
-#endif
-                    ok = 0;
-                    break;
-                }
+		    console_fprintf(stderr, "- no success\n");
+#endif
+		    ok = 0;
+		    break;
+		}
 #ifdef PROPERTY_DEBUG
-                console_fprintf(stderr, "- type:%x format:%d nitems:%d bytes_after:%d\n", actual_type, actual_format, nitems, bytes_after);
-#endif
-                if (actual_type == None) {
-                    // The property does not exist in the specified window
-                    ok = 0;
-                    break;
-                }
-                typeID = __MKATOMOBJ(actual_type);
-            
-                nReturnedBytes = nitems * (actual_format == 32 ? sizeof(long) : actual_format / 8);
-                if (! cp) {
-                    cp = cp2 = (char *)malloc(nReturnedBytes+bytes_after);
-                    if (! cp) {
-                        XFree(data);
-                        goto fail;
-                    }
-                } else {
-                    cp2 = cp + nread;
-                }
-
-                nread += nReturnedBytes;
-                memcpy(cp2, data, nReturnedBytes);
-                XFree(data);
-            } while (bytes_after > 0);
-
-            if (ok) {
-                switch (actual_format) {
-                case 32:
-                    // bad design: even though it says "32",
-                    // what is really returned are longs.
-                    // this does make a difference on 64bit machines!
-                    val = __stArrayFromCULongArray((unsigned long*)cp, nread/sizeof(long));
-                    break;
-                case 16:
-                    val = __stArrayFromCUShortArray((unsigned short*)cp, nread/2);
-                    break;
-                case 8:
-                default:
-                    if (actual_type == XA_STRING) {
-                        val = __MKSTRING_L(cp, nread);
-                    } else {
-                        val = __MKBYTEARRAY(cp, nread);
-                    }
-                    break;
-                }
-                if (cp) free(cp);
-                goto done;
-            }
-        }
-    }
-fail: 
+		console_fprintf(stderr, "- type:%x format:%d nitems:%d bytes_after:%d\n", actual_type, actual_format, nitems, bytes_after);
+#endif
+		if (actual_type == None) {
+		    // The property does not exist in the specified window
+		    ok = 0;
+		    break;
+		}
+		typeID = __MKATOMOBJ(actual_type);
+
+		nReturnedBytes = nitems * (actual_format == 32 ? sizeof(long) : actual_format / 8);
+		if (! cp) {
+		    cp = cp2 = (char *)malloc(nReturnedBytes+bytes_after);
+		    if (! cp) {
+			XFree(data);
+			goto fail;
+		    }
+		} else {
+		    cp2 = cp + nread;
+		}
+
+		nread += nReturnedBytes;
+		memcpy(cp2, data, nReturnedBytes);
+		XFree(data);
+	    } while (bytes_after > 0);
+
+	    if (ok) {
+		switch (actual_format) {
+		case 32:
+		    // bad design: even though it says "32",
+		    // what is really returned are longs.
+		    // this does make a difference on 64bit machines!
+		    val = __stArrayFromCULongArray((unsigned long*)cp, nread/sizeof(long));
+		    break;
+		case 16:
+		    val = __stArrayFromCUShortArray((unsigned short*)cp, nread/2);
+		    break;
+		case 8:
+		default:
+		    if (actual_type == XA_STRING) {
+			val = __MKSTRING_L(cp, nread);
+		    } else {
+			val = __MKBYTEARRAY(cp, nread);
+		    }
+		    break;
+		}
+		if (cp) free(cp);
+		goto done;
+	    }
+	}
+    }
+fail:
     if (cp) free(cp);
     RETURN(nil);
 done:;
@@ -10821,59 +10821,59 @@
 
 %{  /* UNLIMITEDSTACK */
     if (ISCONNECTED && __isAtomID(propertyID) && __isAtomID(typeID)) {
-        Display *dpy = myDpy;
-        Atom prop, type;
-        Window window;
-
-        prop = __AtomVal(propertyID);
-        type = __AtomVal(typeID);
-
-        if (__isExternalAddress(aWindowID)) {
-            window = __WindowVal(aWindowID);
-        } else if (aWindowID == nil) {
-            window = DefaultRootWindow(dpy);
-        } else if (__isInteger(aWindowID)) {
-            window = (Window)__unsignedLongIntVal(aWindowID);
-        } else {
-            RETURN(false);
-        }
-
-        retval = true;
-
-        ENTER_XLIB();
-        if (__isInteger(anObject)) {
-            unsigned INT value = __longIntVal(anObject);
-            XChangeProperty(dpy, window, prop, type, 32,
-                            PropModeReplace,
-                            (unsigned char *)&value, 1);
-        } else if (__isByteArrayLike(anObject)) {
-            XChangeProperty(dpy, window, prop, type, 8,
-                            PropModeReplace,
-                            __byteArrayVal(anObject),
-                            __byteArraySize(anObject));
-        } else if (__isWords(anObject)) {
-            /* wordArray-like (16bit-string) object */
-            XChangeProperty(dpy, window, prop, type, 16,
-                            PropModeReplace,
-                            __stringVal(anObject),
-                            __wordArraySize(anObject));
-        } else if (__isIntegerArray(anObject)) {
-            /* array of atoms */
-            XChangeProperty(dpy, window, prop, type, 32,
-                            PropModeReplace,
-                            (char *)__integerArrayVal(anObject),
-                            __integerArraySize(anObject));
-        } else if (__isStringLike(anObject)) {
-            XChangeProperty(dpy, window, prop, type, 8,
-                            PropModeReplace,
-                            __stringVal(anObject),
-                            __stringSize(anObject));
-        } else {
-            retval = false;
-        }
-        LEAVE_XLIB();
-
-        DPRINTF(("changeProp win=%"_lx_" prop=%"_lx_" type=%"_lx_"\n", (INT)window, (INT)prop, (INT)type));
+	Display *dpy = myDpy;
+	Atom prop, type;
+	Window window;
+
+	prop = __AtomVal(propertyID);
+	type = __AtomVal(typeID);
+
+	if (__isExternalAddress(aWindowID)) {
+	    window = __WindowVal(aWindowID);
+	} else if (aWindowID == nil) {
+	    window = DefaultRootWindow(dpy);
+	} else if (__isInteger(aWindowID)) {
+	    window = (Window)__unsignedLongIntVal(aWindowID);
+	} else {
+	    RETURN(false);
+	}
+
+	retval = true;
+
+	ENTER_XLIB();
+	if (__isInteger(anObject)) {
+	    unsigned INT value = __longIntVal(anObject);
+	    XChangeProperty(dpy, window, prop, type, 32,
+			    PropModeReplace,
+			    (unsigned char *)&value, 1);
+	} else if (__isByteArrayLike(anObject)) {
+	    XChangeProperty(dpy, window, prop, type, 8,
+			    PropModeReplace,
+			    __byteArrayVal(anObject),
+			    __byteArraySize(anObject));
+	} else if (__isWords(anObject)) {
+	    /* wordArray-like (16bit-string) object */
+	    XChangeProperty(dpy, window, prop, type, 16,
+			    PropModeReplace,
+			    __stringVal(anObject),
+			    __wordArraySize(anObject));
+	} else if (__isIntegerArray(anObject)) {
+	    /* array of atoms */
+	    XChangeProperty(dpy, window, prop, type, 32,
+			    PropModeReplace,
+			    (char *)__integerArrayVal(anObject),
+			    __integerArraySize(anObject));
+	} else if (__isStringLike(anObject)) {
+	    XChangeProperty(dpy, window, prop, type, 8,
+			    PropModeReplace,
+			    __stringVal(anObject),
+			    __stringSize(anObject));
+	} else {
+	    retval = false;
+	}
+	LEAVE_XLIB();
+
+	DPRINTF(("changeProp win=%"_lx_" prop=%"_lx_" type=%"_lx_"\n", (INT)window, (INT)prop, (INT)type));
     }
 %}.
     ^ retval
@@ -10890,9 +10890,9 @@
     |windowID propertyAtoms|
 
     aWindowOrWindowIDOrNil isView ifTrue:[
-        windowID := aWindowOrWindowIDOrNil drawableId.
+	windowID := aWindowOrWindowIDOrNil drawableId.
     ] ifFalse:[
-        windowID := aWindowOrWindowIDOrNil.
+	windowID := aWindowOrWindowIDOrNil.
     ].
 
 %{
@@ -10901,40 +10901,40 @@
     int i;
 
     if (ISCONNECTED) {
-        Display *dpy = myDpy;
-        int numProps = 0;
-
-        if (__isExternalAddress(windowID)) {
-            window = __WindowVal(windowID);
-        } else if (windowID == nil) {
-            window = DefaultRootWindow(dpy);
-        } else if (__isInteger(windowID)) {
-            window = (Window)__unsignedLongIntVal(windowID);
-        } else {
-            goto fail;
-        }
-
-        ENTER_XLIB();
-        atomListPtr = XListProperties(dpy, window, &numProps);
-        LEAVE_XLIB();
-
-        if (atomListPtr == NULL) {
-            RETURN (nil);
-        }
-
-        propertyAtoms = __ARRAY_NEW_INT(numProps);
-        if (propertyAtoms == nil) {
-            goto fail;
-        }
-
-        for (i=0; i<numProps; i++) {
-            OBJ atm;
-
-            atm = __MKATOMOBJ(atomListPtr[i]);
-            __ArrayInstPtr(propertyAtoms)->a_element[i] = atm; __STORE(propertyAtoms, atm);
-        }
-        XFree(atomListPtr);
-        RETURN (propertyAtoms);
+	Display *dpy = myDpy;
+	int numProps = 0;
+
+	if (__isExternalAddress(windowID)) {
+	    window = __WindowVal(windowID);
+	} else if (windowID == nil) {
+	    window = DefaultRootWindow(dpy);
+	} else if (__isInteger(windowID)) {
+	    window = (Window)__unsignedLongIntVal(windowID);
+	} else {
+	    goto fail;
+	}
+
+	ENTER_XLIB();
+	atomListPtr = XListProperties(dpy, window, &numProps);
+	LEAVE_XLIB();
+
+	if (atomListPtr == NULL) {
+	    RETURN (nil);
+	}
+
+	propertyAtoms = __ARRAY_NEW_INT(numProps);
+	if (propertyAtoms == nil) {
+	    goto fail;
+	}
+
+	for (i=0; i<numProps; i++) {
+	    OBJ atm;
+
+	    atm = __MKATOMOBJ(atomListPtr[i]);
+	    __ArrayInstPtr(propertyAtoms)->a_element[i] = atm; __STORE(propertyAtoms, atm);
+	}
+	XFree(atomListPtr);
+	RETURN (propertyAtoms);
     }
 fail: ;
 %}.
@@ -10963,7 +10963,7 @@
     self setProperty:#'_NET_WM_ICON' type:#CARDINAL value:buffer for:aWindowOrWindowID
 
     "
-        Display setIcon:0 for:Transcript
+	Display setIcon:0 for:Transcript
     "
 
     "Modified (comment): / 26-04-2018 / 10:59:17 / stefan"
@@ -10975,21 +10975,21 @@
     |propertyAtomID typeAtomID windowIDOrNil|
 
     propertySymbolOrAtomID isString ifTrue:[
-        propertyAtomID := self atomIDOf:propertySymbolOrAtomID create:false.
-        propertyAtomID isNil ifTrue:[^ false].
+	propertyAtomID := self atomIDOf:propertySymbolOrAtomID create:false.
+	propertyAtomID isNil ifTrue:[^ false].
     ] ifFalse:[
-        propertyAtomID := propertySymbolOrAtomID.
+	propertyAtomID := propertySymbolOrAtomID.
     ].
     typeSymbolOrAtomID isString ifTrue:[
-        typeAtomID := self atomIDOf:typeSymbolOrAtomID create:false.
-        typeAtomID isNil ifTrue:[^ false].
+	typeAtomID := self atomIDOf:typeSymbolOrAtomID create:false.
+	typeAtomID isNil ifTrue:[^ false].
     ] ifFalse:[
-        typeAtomID := typeSymbolOrAtomID.
+	typeAtomID := typeSymbolOrAtomID.
     ].
     aWindowOrWindowIDOrNil isView ifTrue:[
-        windowIDOrNil := aWindowOrWindowIDOrNil drawableId.
+	windowIDOrNil := aWindowOrWindowIDOrNil drawableId.
     ] ifFalse:[
-        windowIDOrNil := aWindowOrWindowIDOrNil.
+	windowIDOrNil := aWindowOrWindowIDOrNil.
     ].
 
     ^ self primSetProperty:propertyAtomID type:typeAtomID value:anObject for:windowIDOrNil
@@ -11403,9 +11403,9 @@
     |selectionOwnerWindowId selection|
 
     selectionOwnerWindowId := self getSelectionOwnerOf:clipboardAtom.
-    (selectionOwnerWindowId isNil   "no selection. There is the possibilty that one of our (modal) views has been closed. 
+    (selectionOwnerWindowId isNil   "no selection. There is the possibilty that one of our (modal) views has been closed.
                                      Get the selection from our own buffer"
-     or:[(self viewFromId:selectionOwnerWindowId) notNil]) ifTrue:[
+     or:[self viewIdKnown:selectionOwnerWindowId]) ifTrue:[
         "one of our own views still holds the selection, so return my locally buffered data"
         ^ copyBuffer
     ].
@@ -11442,10 +11442,10 @@
     ^ selection.
 
     "
-       Display getClipboardObjectFor:Transcript id
-    "
-
-    "Modified (format): / 27-04-2018 / 11:57:34 / stefan"
+       Display getClipboardObjectFor:Transcript drawableId
+    "
+
+    "Modified (comment): / 27-04-2018 / 13:39:41 / stefan"
 !
 
 getClipboardText:selectionBufferSymbol for:drawableId
@@ -11461,10 +11461,9 @@
     ].
 
     selectionOwnerWindowId := self getSelectionOwnerOf:selectionId.
-
-    (selectionOwnerWindowId isNil   "no selection. There is the possibilty that one of our (modal) views has been closed. 
+    (selectionOwnerWindowId isNil   "no selection. There is the possibilty that one of our (modal) views has been closed.
                                      Get the selection from our own buffer"
-     or:[(self viewFromId:selectionOwnerWindowId) notNil]) ifTrue:[
+     or:[self viewIdKnown:selectionOwnerWindowId]) ifTrue:[
         "One of our own views still holds the selection, so return my locally buffered data"
         "JV@2012-04-02: Added support for PRIMARY/SELECTION buffers."
         ^ selectionId == primaryAtom ifTrue:[
@@ -11495,12 +11494,12 @@
     ^ selection
 
      "
-       Display getTextSelection:#clipboard for:Transcript id
-       Display getTextSelection:#selection for:Transcript id
+       Display getClipboardText:#clipboard for:Transcript drawableId
+       Display getClipboardText:#selection for:Transcript drawableId
      "
 
     "Modified: / 02-04-2012 / 10:34:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-04-2018 / 11:57:03 / stefan"
+    "Modified (comment): / 27-04-2018 / 13:40:07 / stefan"
 ! !
 
 !XWorkstation methodsFor:'selection sending'!
@@ -11605,14 +11604,14 @@
 
     "Note: some sender code assumes that ST_OBJECT is first"
     ^ #(
-        ST_OBJECT 
-        STRING 
-        UTF8_STRING 
-        TIMESTAMP 
-        TARGETS 
-        LENGTH
-        #'text/plain' 
-        #'text/plain;codeset=utf-8'
+	ST_OBJECT
+	STRING
+	UTF8_STRING
+	TIMESTAMP
+	TARGETS
+	LENGTH
+	#'text/plain'
+	#'text/plain;codeset=utf-8'
     ) collect:[:eachTargetSymbol| self atomIDOf:eachTargetSymbol] as:IntegerArray.
 
     "Modified (format): / 24-11-2017 / 11:06:23 / cg"
@@ -11809,9 +11808,9 @@
     |selectionAtomID|
 
     selectionAtomSymbolOrID isString ifTrue:[
-        selectionAtomID := self atomIDOf:selectionAtomSymbolOrID create:false.
+	selectionAtomID := self atomIDOf:selectionAtomSymbolOrID create:false.
     ] ifFalse:[
-        selectionAtomID := selectionAtomSymbolOrID.
+	selectionAtomID := selectionAtomSymbolOrID.
     ].
 
 %{
@@ -11820,27 +11819,27 @@
     if (__isExternalAddress(aWindowId)
      && __isAtomID(selectionAtomID)
      && ISCONNECTED) {
-        Display *dpy = myDpy;
-        Time time;
-
-        win = __WindowVal(aWindowId);
-
-        if (anIntegerTimestamp == nil) {
-            /*
-             * the ICCCM convention says: you should set the time to the time when
-             * the selection was acquired and not to CurrentTime
-             */
-            time = CurrentTime;
-        } else if (__isInteger(anIntegerTimestamp)) {
-            time = __unsignedLongIntVal(anIntegerTimestamp);
-        } else
-            goto err;
-
-        DPRINTF(("setOwner prop=%"_lx_" win=%"_lx_"\n", (INT)__AtomVal(selectionAtomID), (INT)win));
-        ENTER_XLIB();
-        XSetSelectionOwner(dpy, __AtomVal(selectionAtomID), win, time);
-        RETURN (self);
-        LEAVE_XLIB();
+	Display *dpy = myDpy;
+	Time time;
+
+	win = __WindowVal(aWindowId);
+
+	if (anIntegerTimestamp == nil) {
+	    /*
+	     * the ICCCM convention says: you should set the time to the time when
+	     * the selection was acquired and not to CurrentTime
+	     */
+	    time = CurrentTime;
+	} else if (__isInteger(anIntegerTimestamp)) {
+	    time = __unsignedLongIntVal(anIntegerTimestamp);
+	} else
+	    goto err;
+
+	DPRINTF(("setOwner prop=%"_lx_" win=%"_lx_"\n", (INT)__AtomVal(selectionAtomID), (INT)win));
+	ENTER_XLIB();
+	XSetSelectionOwner(dpy, __AtomVal(selectionAtomID), win, time);
+	RETURN (self);
+	LEAVE_XLIB();
     }
 err:;
 %}.
@@ -12309,7 +12308,7 @@
 !
 
 mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos
-              width:w height:h minExtent:minExt maxExtent:maxExt
+	      width:w height:h minExtent:minExt maxExtent:maxExt
 
     <context: #return>
 
@@ -12321,26 +12320,26 @@
     |wicon wiconId iconMaskId wiconView wiconViewId wlabel minW minH maxW maxH|
 
     aBoolean ifTrue:[
-        wicon := aView icon.
-        wicon notNil ifTrue:[
-            wiconId := wicon drawableId.
-            wicon mask notNil ifTrue:[
-                iconMaskId := wicon mask drawableId.
-            ].
-        ].
-        wiconView := aView iconView.
-        wiconView notNil ifTrue:[
-            wiconViewId := wiconView drawableId
-        ].
-        wlabel := aView label.
+	wicon := aView icon.
+	wicon notNil ifTrue:[
+	    wiconId := wicon drawableId.
+	    wicon mask notNil ifTrue:[
+		iconMaskId := wicon mask drawableId.
+	    ].
+	].
+	wiconView := aView iconView.
+	wiconView notNil ifTrue:[
+	    wiconViewId := wiconView drawableId
+	].
+	wlabel := aView label.
     ].
     minExt notNil ifTrue:[
-        minW := minExt x.
-        minH := minExt y.
+	minW := minExt x.
+	minH := minExt y.
     ].
     maxExt notNil ifTrue:[
-        maxW := maxExt x.
-        maxH := maxExt y.
+	maxW := maxExt x.
+	maxH := maxExt y.
     ].
 %{
 
@@ -12350,91 +12349,91 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-        Display *dpy = myDpy;
-
-        win = __WindowVal(aWindowId);
-
-        szhints.flags = 0;
-        if (__bothSmallInteger(xPos, yPos)) {
-            szhints.x = __intVal(xPos);
-            szhints.y = __intVal(yPos);
-            szhints.flags |= USPosition;
-        }
-        if (__bothSmallInteger(w, h)) {
-            szhints.width = __intVal(w);
-            szhints.height = __intVal(h);
-            szhints.flags |= USSize;
-        }
-        if (__bothSmallInteger(minW, minH)) {
-            szhints.flags |= PMinSize;
-            szhints.min_width = __intVal(minW);
-            szhints.min_height = __intVal(minH);
-        }
-        if (__bothSmallInteger(maxW, maxH)) {
-            szhints.flags |= PMaxSize;
-            szhints.max_width = __intVal(maxW);
-            szhints.max_height = __intVal(maxH);
-        }
-
-        if (aBoolean == true) {
-            char *windowName = "";
-            Pixmap iconBitmap = (Pixmap)0;
-            Pixmap iconMask = (Pixmap)0;
-            Window iconWindow = (Window)0;
-
-            if (__isExternalAddress(wiconId))
-                iconBitmap = __PixmapVal(wiconId);
-
-            if (__isExternalAddress(iconMaskId)) {
-                iconMask = __PixmapVal(iconMaskId);
-            }
-
-            if (__isExternalAddress(wiconViewId))
-                iconWindow = __WindowVal(wiconViewId);
-
-            if (__isStringLike(wlabel))
-                windowName = (char *) __stringVal(wlabel);
-
-            if (iconBitmap || windowName) {
-                ENTER_XLIB();
-                XSetStandardProperties(dpy, win,
-                                        windowName, windowName,
-                                        iconBitmap,
-                                        0, 0, &szhints);
-                LEAVE_XLIB();
-            }
-
-            wmhints.flags = 0;
-            if (iconBitmap) {
-                wmhints.flags |= IconPixmapHint;
-                wmhints.icon_pixmap = iconBitmap;
-            }
-            if (iconMask) {
-                wmhints.flags |= IconMaskHint;
-                wmhints.icon_mask = iconMask;
-            }
-            if (iconWindow) {
-                wmhints.flags |= IconWindowHint;
-                wmhints.icon_window = iconWindow;
-            }
-
-            wmhints.initial_state = IconicState;
-            wmhints.flags |= StateHint;
-            ENTER_XLIB();
-            XSetWMHints(dpy, win, &wmhints);
-            LEAVE_XLIB();
-        }
-
-        if (szhints.flags) {
-            ENTER_XLIB();
-            XSetNormalHints(dpy, win, &szhints);
-            LEAVE_XLIB();
-        }
-
-        ENTER_XLIB();
-        XMapWindow(dpy, win);
-        LEAVE_XLIB();
-        RETURN ( self );
+	Display *dpy = myDpy;
+
+	win = __WindowVal(aWindowId);
+
+	szhints.flags = 0;
+	if (__bothSmallInteger(xPos, yPos)) {
+	    szhints.x = __intVal(xPos);
+	    szhints.y = __intVal(yPos);
+	    szhints.flags |= USPosition;
+	}
+	if (__bothSmallInteger(w, h)) {
+	    szhints.width = __intVal(w);
+	    szhints.height = __intVal(h);
+	    szhints.flags |= USSize;
+	}
+	if (__bothSmallInteger(minW, minH)) {
+	    szhints.flags |= PMinSize;
+	    szhints.min_width = __intVal(minW);
+	    szhints.min_height = __intVal(minH);
+	}
+	if (__bothSmallInteger(maxW, maxH)) {
+	    szhints.flags |= PMaxSize;
+	    szhints.max_width = __intVal(maxW);
+	    szhints.max_height = __intVal(maxH);
+	}
+
+	if (aBoolean == true) {
+	    char *windowName = "";
+	    Pixmap iconBitmap = (Pixmap)0;
+	    Pixmap iconMask = (Pixmap)0;
+	    Window iconWindow = (Window)0;
+
+	    if (__isExternalAddress(wiconId))
+		iconBitmap = __PixmapVal(wiconId);
+
+	    if (__isExternalAddress(iconMaskId)) {
+		iconMask = __PixmapVal(iconMaskId);
+	    }
+
+	    if (__isExternalAddress(wiconViewId))
+		iconWindow = __WindowVal(wiconViewId);
+
+	    if (__isStringLike(wlabel))
+		windowName = (char *) __stringVal(wlabel);
+
+	    if (iconBitmap || windowName) {
+		ENTER_XLIB();
+		XSetStandardProperties(dpy, win,
+					windowName, windowName,
+					iconBitmap,
+					0, 0, &szhints);
+		LEAVE_XLIB();
+	    }
+
+	    wmhints.flags = 0;
+	    if (iconBitmap) {
+		wmhints.flags |= IconPixmapHint;
+		wmhints.icon_pixmap = iconBitmap;
+	    }
+	    if (iconMask) {
+		wmhints.flags |= IconMaskHint;
+		wmhints.icon_mask = iconMask;
+	    }
+	    if (iconWindow) {
+		wmhints.flags |= IconWindowHint;
+		wmhints.icon_window = iconWindow;
+	    }
+
+	    wmhints.initial_state = IconicState;
+	    wmhints.flags |= StateHint;
+	    ENTER_XLIB();
+	    XSetWMHints(dpy, win, &wmhints);
+	    LEAVE_XLIB();
+	}
+
+	if (szhints.flags) {
+	    ENTER_XLIB();
+	    XSetNormalHints(dpy, win, &szhints);
+	    LEAVE_XLIB();
+	}
+
+	ENTER_XLIB();
+	XMapWindow(dpy, win);
+	LEAVE_XLIB();
+	RETURN ( self );
     }
 %}.
     self primitiveFailedOrClosedConnection
@@ -13048,20 +13047,20 @@
     |iconId|
 
     aForm notNil ifTrue:[
-        iconId := aForm drawableId
+	iconId := aForm drawableId
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconId)
      && __isExternalAddress(aWindowId)) {
-        XWMHints hints;
-
-        hints.icon_pixmap = __PixmapVal(iconId);
-        hints.flags = IconPixmapHint;
-        ENTER_XLIB();
-        XSetWMHints(myDpy, __WindowVal(aWindowId), &hints);
-        LEAVE_XLIB();
-        RETURN ( self );
+	XWMHints hints;
+
+	hints.icon_pixmap = __PixmapVal(iconId);
+	hints.flags = IconPixmapHint;
+	ENTER_XLIB();
+	XSetWMHints(myDpy, __WindowVal(aWindowId), &hints);
+	LEAVE_XLIB();
+	RETURN ( self );
     }
 %}.
     self primitiveFailedOrClosedConnection
@@ -13077,28 +13076,28 @@
     |iconId maskId|
 
     aForm notNil ifTrue:[
-        iconId := aForm drawableId.
+	iconId := aForm drawableId.
     ].
     aMaskForm notNil ifTrue:[
-        maskId := aMaskForm drawableId.
+	maskId := aMaskForm drawableId.
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconId)
      && __isExternalAddress(aWindowId)) {
-        XWMHints hints;
-
-        hints.icon_pixmap = __PixmapVal(iconId);
-        hints.flags = IconPixmapHint;
-        if ((maskId != nil)
-         && __isExternalAddress(maskId)) {
-            hints.icon_mask = __PixmapVal(maskId);
-            hints.flags |= IconMaskHint;
-        }
-        ENTER_XLIB();
-        XSetWMHints(myDpy, __WindowVal(aWindowId), &hints);
-        LEAVE_XLIB();
-        RETURN ( self );
+	XWMHints hints;
+
+	hints.icon_pixmap = __PixmapVal(iconId);
+	hints.flags = IconPixmapHint;
+	if ((maskId != nil)
+	 && __isExternalAddress(maskId)) {
+	    hints.icon_mask = __PixmapVal(maskId);
+	    hints.flags |= IconMaskHint;
+	}
+	ENTER_XLIB();
+	XSetWMHints(myDpy, __WindowVal(aWindowId), &hints);
+	LEAVE_XLIB();
+	RETURN ( self );
     }
 %}.
     self primitiveFailedOrClosedConnection
@@ -13114,20 +13113,20 @@
     |iconWindowId|
 
     aView notNil ifTrue:[
-        iconWindowId := aView drawableId.
+	iconWindowId := aView drawableId.
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconWindowId)
      && __isExternalAddress(aWindowId)) {
-        XWMHints wmhints;
-
-        wmhints.icon_window = __WindowVal(iconWindowId);
-        wmhints.flags = IconWindowHint;
-        ENTER_XLIB();
-        XSetWMHints(myDpy, __WindowVal(aWindowId), &wmhints);
-        LEAVE_XLIB();
-        RETURN ( self );
+	XWMHints wmhints;
+
+	wmhints.icon_window = __WindowVal(iconWindowId);
+	wmhints.flags = IconWindowHint;
+	ENTER_XLIB();
+	XSetWMHints(myDpy, __WindowVal(aWindowId), &wmhints);
+	LEAVE_XLIB();
+	RETURN ( self );
     }
 %}.
     self primitiveFailedOrClosedConnection
@@ -13306,19 +13305,19 @@
     | valueAtom |
 
     self assert:(#(_NET_WM_WINDOW_TYPE_DESKTOP
-                  _NET_WM_WINDOW_TYPE_DOCK
-                  _NET_WM_WINDOW_TYPE_TOOLBAR
-                  _NET_WM_WINDOW_TYPE_MENU
-                  _NET_WM_WINDOW_TYPE_UTILITY
-                  _NET_WM_WINDOW_TYPE_SPLASH
-                  _NET_WM_WINDOW_TYPE_DIALOG
-                  _NET_WM_WINDOW_TYPE_NORMAL) includes: aSymbol).
+		  _NET_WM_WINDOW_TYPE_DOCK
+		  _NET_WM_WINDOW_TYPE_TOOLBAR
+		  _NET_WM_WINDOW_TYPE_MENU
+		  _NET_WM_WINDOW_TYPE_UTILITY
+		  _NET_WM_WINDOW_TYPE_SPLASH
+		  _NET_WM_WINDOW_TYPE_DIALOG
+		  _NET_WM_WINDOW_TYPE_NORMAL) includes: aSymbol).
 
     valueAtom := self atomIDOf:aSymbol create:false.
     valueAtom isNil ifTrue:[
-        "/Hmm, no such property, not running under EWMH compliant WM?
-        self breakPoint: #jv.
-        ^ self
+	"/Hmm, no such property, not running under EWMH compliant WM?
+	self breakPoint: #jv.
+	^ self
     ].
 
     self setProperty:#'_NET_WM_WINDOW_TYPE' type:#ATOM value:valueAtom for:aWindowOrWindowId.
@@ -13480,47 +13479,47 @@
     |selection|
 
     buffer isNil ifTrue:[
-        ^ nil.
+	^ nil.
     ].
 
     targetID == (display atomIDOf:#STRING) ifTrue:[
-        display clipboardEncoding notNil ifTrue:[
-            selection := buffer decodeFrom:display clipboardEncoding
-        ].
-        selection := buffer.
+	display clipboardEncoding notNil ifTrue:[
+	    selection := buffer decodeFrom:display clipboardEncoding
+	].
+	selection := buffer.
     ] ifFalse:[targetID == (display atomIDOf:#'UTF8_STRING') ifTrue:[
-        "/ Transcript show:'UTF8: '; showCR:buffer storeString.
-        selection := buffer utf8Decoded.
+	"/ Transcript show:'UTF8: '; showCR:buffer storeString.
+	selection := buffer utf8Decoded.
     ] ifFalse:[targetID == (display atomIDOf:#TEXT) ifTrue:[
-        "/ Transcript show:'TEXT: '; showCR:buffer storeString.
-        selection := buffer asString
+	"/ Transcript show:'TEXT: '; showCR:buffer storeString.
+	selection := buffer asString
     ] ifFalse:[targetID == (display atomIDOf:#'COMPOUND_TEXT') ifTrue:[
-        "/ Transcript show:'COMPOUND_TEXT: '; showCR:buffer storeString.
-        selection := buffer asString
+	"/ Transcript show:'COMPOUND_TEXT: '; showCR:buffer storeString.
+	selection := buffer asString
     ]]]].
 
     selection notNil ifTrue:[
-        (selection endsWith:Character cr) ifTrue:[
-            selection := selection asStringCollection copyWith:''
-        ].
-        ^ selection.
+	(selection endsWith:Character cr) ifTrue:[
+	    selection := selection asStringCollection copyWith:''
+	].
+	^ selection.
     ].
 
     targetID == (display atomIDOf:#'TARGETS') ifTrue:[
-        ^ buffer
+	^ buffer
     ].
     targetID == (display atomIDOf:#'ST_OBJECT') ifTrue:[
-        "require libboss to be loaded"
-        (Smalltalk isClassLibraryLoaded:'libstx_libboss') ifFalse:[
-            'SelectionFetch: cannot decode object (libboss library missing)' errorPrintCR.
-            ^ nil
-        ].
-        ^ (Object
-            readBinaryFrom:(ReadStream on:buffer)
-            onError:[:ex |
-                ('SelectionFetch: error while decoding binary object: ',ex description) errorPrintCR.
-                nil
-            ])
+	"require libboss to be loaded"
+	(Smalltalk isClassLibraryLoaded:'libstx_libboss') ifFalse:[
+	    'SelectionFetch: cannot decode object (libboss library missing)' errorPrintCR.
+	    ^ nil
+	].
+	^ (Object
+	    readBinaryFrom:(ReadStream on:buffer)
+	    onError:[:ex |
+		('SelectionFetch: error while decoding binary object: ',ex description) errorPrintCR.
+		nil
+	    ])
     ].
 
     'XWorkstation: unimplemented property targetID: ' infoPrint. (display atomName:targetID) infoPrint.
@@ -13564,26 +13563,26 @@
     |property propertyValue|
 
     incremental ifFalse:[
-        "ignore property changes until we are in incremental mode"
-        ^ self.
+	"ignore property changes until we are in incremental mode"
+	^ self.
     ].
 
     property := display getProperty:propertyID from:drawableID delete:true.
     propertyValue := property value.
 
     propertyValue size == 0 ifTrue:[
-        "property with size 0 signals end of transfer"
-        done := true.
+	"property with size 0 signals end of transfer"
+	done := true.
     ] ifFalse:[
-        buffer isNil ifTrue:[
-            targetID := property key.
-            buffer := propertyValue.
-        ] ifFalse:[
-            targetID ~= property key ifTrue:[
-                'XWorkstation(warning): targetID change in incremental select: ' errorPrint. display errorPrintCR.
-            ].
-            buffer := buffer, propertyValue.
-        ].
+	buffer isNil ifTrue:[
+	    targetID := property key.
+	    buffer := propertyValue.
+	] ifFalse:[
+	    targetID ~= property key ifTrue:[
+		'XWorkstation(warning): targetID change in incremental select: ' errorPrint. display errorPrintCR.
+	    ].
+	    buffer := buffer, propertyValue.
+	].
     ].
 
     "Modified (comment): / 25-01-2018 / 19:01:10 / mawalch"