move layout from dialog to systemwindow

*distant sounds of hammering in basement*

so we can get Floating Windows layout aware
as well without duplicate of dialog layout logic

Change-Id: I063375f2f7d4e5c3bfbfedf55649078d4dbe4139
coverity#706466 Uncaught exception

and

coverity#706463 Uncaught exception

Change-Id: I77cb09054f00d86cd3e206e44ef4942ddf148a7f