diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index c5eda736b..db484ffdc 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -2977,14 +2977,15 @@ WmIconbitmapCmd( TkMacOSXMakeRealWindowExist(winPtr); } if (WmSetAttribute(winPtr, TkMacOSXGetNSWindowForDrawable(winPtr->window), interp, - WMATT_TITLEPATH, objv[3]) == TCL_OK) { - if (!len) { - if (wmPtr->hints.icon_pixmap != None) { - Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap); - wmPtr->hints.icon_pixmap = None; - } - wmPtr->hints.flags &= ~IconPixmapHint; + WMATT_TITLEPATH, objv[3]) != TCL_OK) { + return TCL_ERROR; + } + if (!len) { + if (wmPtr->hints.icon_pixmap != None) { + Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap); + wmPtr->hints.icon_pixmap = None; } + wmPtr->hints.flags &= ~IconPixmapHint; } else { pixmap = Tk_GetBitmap(interp, (Tk_Window)winPtr, str); if (pixmap == None) { diff --git a/tests/unixWm.test b/tests/unixWm.test index 14d6359da..8f1bd2253 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -815,15 +815,9 @@ test unixWm-22.2 {Tk_WmCmd procedure, "iconbitmap" option} {unix testwrapper} { WM_HINTS] 0]]] lappend result [wm iconbitmap .t] $bit } {{} questhead 0x4 {} 0x0} -if {[tk windowingsystem] eq "aqua"} { - set result_22_3 {0 {}} -} else { - set result_22_3 {1 {bitmap "bad-bitmap" not defined}} -} -test unixWm-22.3 {Tk_WmCmd procedure, "iconbitmap" option for unix only} \ -unix { +test unixWm-22.3 {Tk_WmCmd procedure, "iconbitmap" option} unix { list [catch {wm iconbitmap .t bad-bitmap} msg] $msg -} $result_22_3 +} {1 {bitmap "bad-bitmap" not defined}} test unixWm-23.1 {Tk_WmCmd procedure, "iconify" option} unix { list [catch {wm iconify .t 12} msg] $msg diff --git a/tests/wm.test b/tests/wm.test index 85aaa9044..b5500f892 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -878,11 +878,11 @@ test wm-iconbitmap-1.2.2 {usage} -constraints win -returnCodes error -body { test wm-iconbitmap-1.3 {usage} -constraints win -returnCodes error -body { wm iconbitmap .t 12 13 } -result {illegal option "12" must be "-default"} -test wm-iconbitmap-1.4 {usage} -constraints notAqua -returnCodes error -body { +test wm-iconbitmap-1.4 {usage} -returnCodes error -body { wm iconbitmap .t bad-bitmap } -result {bitmap "bad-bitmap" not defined} -test wm-iconbitmap-2.1 {setting and reading values} -constraints notAqua -setup { +test wm-iconbitmap-2.1 {setting and reading values} -setup { set result {} } -body { lappend result [wm iconbitmap .t]