[PATCH] Loading startup files before scanning windows

Lincoln de Sousa <[email protected]>
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <1294080353-sup-2215@lixeiro>
Hello there,

I have 3 kinds of windows configured to not be managed by rp in my
~/.ratpoisonrc file. Just like this:

  unmanage Top Expanded Edge Panel
  unmanage x-nautilus-desktop
  unmanage Calendar

But when I run ratpoison with these windows open, ratpoison scans for
open windows before loading my rc file and all these windows are placed
wrongly. After that, I have to set their position manually, killing the
apps and opening them again.

This detail would not be a problem if ratpoison could be loaded before
these windows, but I have a use case that prevents me to fix it easily.

I'm using ratpoison as the window manager under Gnome [0] and it is
gnome-session that actually runs ratpoision, not me or xinit. This way,
nautilus and gnome-panel are `managed' by ratpoison and their position
are set wrongly.

Is there something that I can do to fix this problem without this patch?
If not, should I improve/rewrite anything to get this patch applied?


Thank you for your attention and cheers,
-- 
Lincoln de Sousa <[email protected]>
xmpp:[email protected]
http://comum.org
http://culturadigital.br

_______________________________________________
Ratpoison-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ratpoison-devel
0001-Loading-startup-files-before-scanning-for-windows.patch (application/octet-stream, 1.2 KB)
From 0bffab5c9998a218e5e2d58fdbaba5c16685d07b Mon Sep 17 00:00:00 2001
From: Lincoln de Sousa <[email protected]>
Date: Sun, 2 Jan 2011 14:39:27 -0200
Subject: [PATCH] Loading startup files before scanning for windows.

This is important to make ratpoison aware of which windows the user
set as unmanaged.
---
 src/main.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 417fc1a..9feb5b1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -719,6 +719,13 @@ main (int argc, char *argv[])
   initialize_default_keybindings ();
   history_load ();
 
+  /* Reading startup files *before* scanning for windows. This
+   * precedence is important to make ratpoison aware of which windows
+   * the user set as unmanaged. */
+  read_startup_files (alt_rcfile);
+  if (alt_rcfile)
+    free (alt_rcfile);
+
   /* Scan for windows */
   if (screen_arg)
     {
@@ -734,10 +741,6 @@ main (int argc, char *argv[])
         }
     }
 
-  read_startup_files (alt_rcfile);
-  if (alt_rcfile)
-    free (alt_rcfile);
-
   /* Indicate to the user that ratpoison has booted. */
   if (defaults.startup_message)
     show_welcome_message();
-- 
1.7.2.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.