[PATCH] Introduces metacity window manager (needed for #520146)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need a solid window manager to be able to open and close the
nm-connection-editor window.
---
 anaconda             |   41 ++++++++++++++++------
 scripts/upd-instroot |   92 +++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 114 insertions(+), 19 deletions(-)

diff --git a/anaconda b/anaconda
index 6b33988..f4bceca 100755
--- a/anaconda
+++ b/anaconda
@@ -36,7 +36,7 @@ from tempfile import mkstemp
 
 # keep up with process ID of miniwm if we start it
 
-miniwm_pid = None
+wm_pid = None
 
 # Make sure messages sent through python's warnings module get logged.
 def AnacondaShowWarning(message, category, filename, lineno, file=sys.stderr, line=None):
@@ -67,22 +67,41 @@ def startMiniWM(root='/'):
 
     return childpid
 
+def startMetacityWM():
+    childpid = os.fork()
+    if not childpid:
+        cmd = '/usr/bin/metacity'
+        if not os.access(cmd, os.X_OK):
+            log.error("Unable to find the window manager binary.")
+            sys.exit(1)
+        args = ['--display', ':1',
+                '--sm-disable']
+        rc = iutil.execWithRedirect(cmd, args, 
+                               stdout='/dev/null', stderr='/dev/null')
+        if rc:
+            log.error("Error running window manager.")
+            sys.exit (rc)
+        else:
+            log.info("The window manager has terminated.")
+            sys.exit(0)
+    return childpid
+
 # function to handle X startup special issues for anaconda
 def doStartupX11Actions(runres="800x600"):
-    global miniwm_pid
+    global wm_pid
 
     setupGraphicalLinks()
 
     # now start up mini-wm
     try:
-        miniwm_pid = startMiniWM()
-        log.info("Started mini-wm")
+        wm_pid = startMetacityWM()
+        log.info("Started metacity, pid %s." % (wm_pid,))
 
     except:
-        miniwm_pid = None
-        log.error("Unable to start mini-wm")
+        wm_pid = None
+        log.error("Unable to start the window manager.")
 
-    if miniwm_pid is not None:
+    if wm_pid is not None:
         import xutils
         import gtk
 
@@ -103,12 +122,12 @@ def doStartupX11Actions(runres="800x600"):
             raise RuntimeError, "X server failed to start"
 
 def doShutdownX11Actions():
-    global miniwm_pid
+    global wm_pid
     
-    if miniwm_pid is not None:
+    if wm_pid is not None:
         try:
-            os.kill(miniwm_pid, 15)
-            os.waitpid(miniwm_pid, 0)
+            os.kill(wm_pid, 15)
+            os.waitpid(wm_pid, 0)
         except:
             pass
 
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 217f997..bd7760a 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -159,7 +159,7 @@ PACKAGES="GConf2 NetworkManager ORBit2 acl anaconda
     anaconda-yum-plugins at-spi atk attr audit-libs bash bitmap-fonts-cjk
     btrfs-progs bzip2 bzip2-libs ca-certificates cairo cjkuni-uming-fonts
     comps-extras coreutils cpio cracklib cracklib-dicts cracklib-python
-    cryptsetup-luks cyrus-sasl-lib db4 dbus dbus-python dejavu-sans-fonts
+    cryptsetup-luks cyrus-sasl-lib db4 dbus dbus-python dbus-x11 dejavu-sans-fonts
     dcbd dejavu-sans-mono-fonts device-mapper device-mapper-libs
     device-mapper-multipath device-mapper-multipath-libs
     dhclient dmraid dmraid-libs
@@ -173,16 +173,17 @@ PACKAGES="GConf2 NetworkManager ORBit2 acl anaconda
     libXaw libXcursor libXdmcp libXevie libXext libXfixes libXfont libXft
     libXi libXinerama libXmu libXpm libXrandr libXrender libXt libXtst
     libXxf86misc libacl libaio libart_lgpl libattr libbdevid libbdevid-python
-    libbonobo libcurl libfontenc libidn libgcc
-    libglade2 libgnomecanvas libgcrypt libgpg-error libjpeg libnl
+    libbonobo libcanberra libcanberra-gtk2 libcurl libfontenc libidn libgcc
+    libglade2 libgnomecanvas libgcrypt libgpg-error libjpeg libnl libogg
     libpng libselinux libselinux-python libsemanage
-    libsemanage-python libsepol libssh2 libstdc++ libthai libtirpc libuser
-    libuser-python libvolume_id libxcb libxkbfile libxml2 lklug-fonts 
+    libsemanage-python libsepol libssh2 libstdc++ libtdb libthai libtirpc 
+    libtool-ltdl libuser
+    libuser-python libvolume_id libvorbis libxcb libxkbfile libxml2 lklug-fonts
     lohit-assamese-fonts lohit-bengali-fonts lohit-gujarati-fonts lohit-hindi-fonts
     lohit-kashmiri-fonts lohit-kannada-fonts lohit-maithili-fonts lohit-marathi-fonts
     lohit-oriya-fonts lohit-punjabi-fonts lohit-sindhi-fonts lohit-tamil-fonts
     lohit-telugu-fonts lvm2 madan-fonts mdadm
-    mesa-dri-drivers mkinitrd module-init-tools nash ncurses neon net-tools
+    mesa-dri-drivers metacity mkinitrd module-init-tools nash ncurses neon net-tools
     newt newt-python nfs-utils nspr nss nss-softokn ntfs-3g
     openldap openssh openssh-server
     pam pango parted pciutils pcre psmisc
@@ -190,12 +191,13 @@ PACKAGES="GConf2 NetworkManager ORBit2 acl anaconda
     python-libs python-nss python-pyblock python-sqlite python-epdb
     python-urlgrabber python-volume_key pyxf86config readline redhat-artwork
     reiserfs-utils rpm rpm-libs rpm-python sed selinux-policy-targeted
-    setup slang smc-meera-fonts specspo sqlite synaptics system-config-date
+    setup slang smc-meera-fonts specspo sqlite startup-notification 
+    synaptics system-config-date
     system-config-keyboard ${brandpkgname}-logos ${brandpkgname}-release
     sysvinit-tools taipeifonts tcp_wrappers tcp_wrappers-libs telnet
     tzdata udev un-core-dotum-fonts urw-fonts util-linux-ng tigervnc-server
     tigervnc-server-module vlgothic-fonts vim-minimal
-    wget wpa_supplicant xkeyboard-config xfsprogs xorg-x11-xauth
+    wget wpa_supplicant xcb-util xkeyboard-config xfsprogs xorg-x11-xauth
     xorg-x11-drivers xorg-x11-font-utils xorg-x11-fonts-ethiopic
     xorg-x11-fonts-misc xorg-x11-server-utils
     xorg-x11-server-Xorg xorg-x11-xkb-utils xorg-x11-xfs yum
@@ -499,10 +501,22 @@ usr/$LIBDIR/libuser/*
 usr/$LIBDIR/pango
 usr/$LIBDIR/python?.?
 usr/$LIBDIR/rpm/rpmpopt
+usr/$LIBDIR/libcanberra.so*
+usr/$LIBDIR/libcanberra-gtk.so*
 usr/$LIBDIR/libiscsi.so*
 usr/$LIBDIR/libfreebl3.so
+usr/$LIBDIR/libmetacity-private.so*
+usr/$LIBDIR/libogg.so*
 usr/$LIBDIR/libsoftokn3.so
 usr/$LIBDIR/libsqlite3.so*
+usr/$LIBDIR/libtdb.so*
+usr/$LIBDIR/libtdl.so*
+usr/$LIBDIR/libstartup-notification-1.so*
+usr/$LIBDIR/libvorbisfile.so*
+usr/$LIBDIR/libvorbis.so*
+usr/$LIBDIR/libxcb-atom.so*
+usr/$LIBDIR/libxcb-aux.so*
+usr/$LIBDIR/libxcb-event.so*
 usr/$LIBDIR/xorg/modules
 usr/$LIBDIR/libnssdbm3.so
 usr/$LIBDIR/xserver/SecurityPolicy
@@ -510,6 +524,7 @@ usr/bin/[
 usr/bin/Xorg
 usr/bin/Xvnc
 usr/bin/chattr*
+usr/bin/dbus-launch
 usr/bin/du
 usr/bin/expr
 usr/bin/gdb-gdbserver
@@ -529,6 +544,7 @@ usr/bin/lsattr*
 usr/bin/lshal
 usr/bin/maketilo
 usr/bin/md5sum
+usr/bin/metacity
 usr/bin/mini-wm
 usr/bin/mkzimage
 usr/bin/pango*
@@ -984,6 +1000,66 @@ directory = /mnt/sysimage/etc
 directory = /mnt/sysimage/etc
 EOF
 
+echo "Creating default metacity theme"
+mkdir -p $DEST/usr/share/themes/Atlanta/metacity-1
+cat > $DEST/usr/share/themes/Atlanta/metacity-1/metacity-theme-1.xml <<EOF
+<?xml version="1.0"?>
+<metacity_theme>
+<info>
+  <name>Anaconda</name>
+  <author>Ales Kozumplik &lt;akozumpl@xxxxxxxxxx&gt;</author>
+  <description>Absolutely minimalist theme for the graphical installer.</description>
+</info>
+
+<frame_geometry name="minimal_geometry" has_title="false" hide_buttons="true">
+  <distance name="left_width" value="0"/>
+  <distance name="right_width" value="0"/>
+  <distance name="bottom_height" value="0"/>
+  <distance name="left_titlebar_edge" value="0"/>
+  <distance name="right_titlebar_edge" value="0"/>
+  <distance name="button_width" value="0"/>
+  <distance name="button_height" value="0"/>
+  <distance name="title_vertical_pad" value="0"/>
+  <border name="title_border" left="0" right="0" top="0" bottom="0"/>
+  <border name="button_border" left="0" right="0" top="0" bottom="0"/>
+</frame_geometry>
+
+<draw_ops name="blank">
+</draw_ops>
+
+<frame_style name="blank_frame_style" geometry="minimal_geometry">
+  <button function="close" state="normal" draw_ops="blank"/>
+  <button function="close" state="pressed" draw_ops="blank"/>
+  <button function="minimize" state="normal" draw_ops="blank"/>
+  <button function="minimize" state="pressed" draw_ops="blank"/>
+  <button function="maximize" state="normal" draw_ops="blank"/>
+  <button function="maximize" state="pressed" draw_ops="blank"/>
+  <button function="menu" state="normal" draw_ops="blank"/>
+  <button function="menu" state="pressed" draw_ops="blank"/>
+  <piece position="title" draw_ops="blank"/>
+</frame_style>
+
+<frame_style_set name="blank_style_set">
+<frame focus="yes" state="normal" resize="both" style="blank_frame_style"/>
+<frame focus="no" state="normal" resize="both" style="blank_frame_style"/>
+<frame focus="yes" state="maximized" style="blank_frame_style"/>
+<frame focus="no" state="maximized" style="blank_frame_style"/>
+<frame focus="yes" state="shaded" style="blank_frame_style"/>
+<frame focus="no" state="shaded" style="blank_frame_style"/>
+<frame focus="yes" state="maximized_and_shaded" style="blank_frame_style"/>
+<frame focus="no" state="maximized_and_shaded" style="blank_frame_style"/>
+</frame_style_set>
+
+<window type="normal" style_set="blank_style_set"/>
+<window type="dialog" style_set="blank_style_set"/>
+<window type="modal_dialog" style_set="blank_style_set"/>
+<window type="menu" style_set="blank_style_set"/>
+<window type="utility" style_set="blank_style_set"/>
+<window type="border" style_set="blank_style_set"/>
+
+</metacity_theme>
+EOF
+
 sed -i 's|\(installforallkernels\) = 0|\1 = 1|' $DEST/etc/yum/pluginconf.d/fedorakmod.conf
 
 #
-- 
1.6.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux