diff --git a/src/appicon.c b/src/appicon.c index 5aefcf39..0a0ab0d0 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -431,30 +431,6 @@ wAppIconPaint(WAppIcon *aicon) } #endif /* HIDDENDOT */ -#ifdef NEWAPPICON - if (!wPreferences.strict_ns && aicon->icon->owner!=NULL) { - int active=0; - if (aicon->main_window==None) { - active = (aicon->icon->owner->flags.focused ? 1 : 0); - } else { - WApplication *wapp; - - wapp = wApplicationOf(aicon->main_window); - if (!wapp) { - active = aicon->icon->owner->flags.focused; - wwarning("error in wAppIconPaint(). Please report it"); - } else { - active = wapp->main_window_desc->flags.focused; - if (wapp->main_window_desc->flags.hidden - || !wapp->main_window_desc->flags.mapped) - active = -1; - } - } - if (active>=0) - drawCorner(aicon->icon, aicon->icon->owner, active); - } -#endif /* NEWAPPICON */ - if (aicon->omnipresent) drawCorner(aicon->icon); diff --git a/src/window.c b/src/window.c index 897db23b..d7b20b1a 100644 --- a/src/window.c +++ b/src/window.c @@ -908,7 +908,27 @@ wManageWindow(WScreen *scr, Window window) && !wwin->flags.miniaturized && !wwin->flags.maximized && !(wwin->normal_hints->flags & (USPosition|PPosition))) { - PlaceWindow(wwin, &x, &y, width, height); + + if (transientOwner && transientOwner->flags.mapped) { + int offs = WMAX(20, 2*transientOwner->frame->top_width); + + x = transientOwner->frame_x + + abs((transientOwner->frame->core->width - width)/2) + offs; + y = transientOwner->frame_y + + abs((transientOwner->frame->core->height - height)/3) + offs; + + if (x < 0) + x = 0; + else if (x + width > scr->scr_width) + x = scr->scr_width - width; + + if (y < 0) + y = 0; + else if (y + height > scr->scr_height) + y = scr->scr_height - height; + } else { + PlaceWindow(wwin, &x, &y, width, height); + } if (wPreferences.window_placement == WPM_MANUAL) dontBring = True; }