- screen->updateNetizenWindowAdd(w->getClientWindow(), id);
-
- if (id != screen->getCurrentWorkspaceID() &&
- screen->doFocusNew()) {
- /*
- not on the focused workspace, so the window is not going to get focus
- but if the user wants new windows focused, then it should get focus
- when this workspace does become focused.
- */
- lastfocus = w;
+ if (! sticky)
+ screen->updateNetizenWindowAdd(w->getClientWindow(), id);
+
+ if (screen->doFocusNew() || (w->isTransient() && w->getTransientFor() &&
+ w->getTransientFor()->isFocused())) {
+ if (id == screen->getCurrentWorkspaceID())
+ w->setInputFocus();
+ else {
+ /*
+ not on the focused workspace, so the window is not going to get focus
+ but if the user wants new windows focused, then it should get focus
+ when this workspace does become focused.
+ */
+ lastfocus = w;
+ }