- if (focused_screen == (BScreen *) 0)
- return (OpenboxWindow *) 0;
- Workspace *w = focused_screen->getCurrentWorkspace();
- if (w == (Workspace *) 0)
- return (OpenboxWindow *) 0;
- return w->focusedWindow();
+ Workspace *w;
+ if (current_screen)
+ if ((w = current_screen->getCurrentWorkspace()))
+ return w->focusedWindow();
+ return (OpenboxWindow *) 0;