summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorVratislav Podzimek <vpodzime@redhat.com>2012-05-17 14:01:58 +0200
committerVratislav Podzimek <vpodzime@redhat.com>2012-06-01 11:43:59 +0200
commit26afbae42eabe5abe74b8c7ed6308059843a6f9c (patch)
treefa4144247ad2d2881aaad5eb469c5946953e9ac4 /anaconda
parent8edfc200303968ea5575f982ad58cf530707e641 (diff)
downloadanaconda-26afbae42eabe5abe74b8c7ed6308059843a6f9c.tar.gz
anaconda-26afbae42eabe5abe74b8c7ed6308059843a6f9c.tar.xz
anaconda-26afbae42eabe5abe74b8c7ed6308059843a6f9c.zip
Initialize X layouts ASAP if given in kickstart or on command line
People expect to have layouts specified in the kickstart or as command line option set up when UI initializes.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda40
1 files changed, 33 insertions, 7 deletions
diff --git a/anaconda b/anaconda
index 9f7de2e62..33782ed26 100755
--- a/anaconda
+++ b/anaconda
@@ -103,13 +103,35 @@ def startAuditDaemon():
os.waitpid(childpid, 0)
# function to handle X startup special issues for anaconda
-def doStartupX11Actions():
+def doStartupX11Actions(keyboard):
+ """
+ Start window manager and set up keyboard layouts if requested in kickstart
+ or on command line.
+
+ @param keyboard: ksdata.keyboard object
+
+ """
+
global wm_pid # pid of the anaconda fork where the window manager is running
# now start up the window manager
wm_pid = startMetacityWM()
log.info("Starting window manager, pid %s." % (wm_pid,))
+ # setup layouts
+ if keyboard.layouts_list:
+ from pyanaconda.xklavier import XklWrapper, XklWrapperError
+
+ layouts = keyboard.layouts_list
+ xklwrapper = XklWrapper.get_instance()
+
+ try:
+ xklwrapper.replace_layouts(layouts)
+
+ except XklWrapperError as xklerr:
+ msg = "Failed to activate layouts %s" % ",".join(layouts)
+ log.error(msg)
+
def set_x_resolution(runres):
# cant do this if no window manager is running because otherwise when we
# open and close an X connection in the xutils calls the X server will exit
@@ -516,7 +538,7 @@ def setupDisplay(anaconda, opts):
signal.pause()
os.environ["DISPLAY"] = ":1"
- doStartupX11Actions()
+ doStartupX11Actions(anaconda.ksdata.keyboard)
except (OSError, RuntimeError):
stdoutLog.warning("X startup failed, falling back to text mode")
anaconda.displayMode = 't'
@@ -540,7 +562,7 @@ def setupDisplay(anaconda, opts):
# if they want us to use VNC do that now
if anaconda.displayMode == 'g' and flags.usevnc:
runVNC(vncS)
- doStartupX11Actions()
+ doStartupX11Actions(anaconda.ksdata.keyboard)
# with X running we can initialize the UI interface
anaconda.initInterface()
@@ -752,6 +774,14 @@ if __name__ == "__main__":
ksdata.method.proxy = anaconda.proxy # FIXME: username/password
ksdata.method.url = anaconda.methodstr
+ # setup keyboard layout from the command line option and let
+ # it override from kickstart if/when X is initialized
+ if opts.keymap:
+ if not ksdata.keyboard.keyboard:
+ ksdata.keyboard.keyboard = opts.keymap
+ anaconda.keyboard.set(opts.keymap)
+ anaconda.keyboard.activate()
+
# now start the interface
setupDisplay(anaconda, opts)
@@ -790,10 +820,6 @@ if __name__ == "__main__":
anaconda.instLanguage.systemLang = opts.lang
anaconda.timezone.setTimezoneInfo(anaconda.instLanguage.getDefaultTimeZone())
- if opts.keymap:
- anaconda.keyboard.set(opts.keymap)
- anaconda.keyboard.activate()
-
from pyanaconda.storage import storageInitialize
from pyanaconda.packaging import payloadInitialize
from pyanaconda.threads import initThreading, threadMgr, AnacondaThread