add the new <placement><active> option from ob 3.4.6
authorDana Jansens <danakj@orodu.net>
Sat, 12 Jan 2008 16:56:05 +0000 (11:56 -0500)
committerDana Jansens <danakj@orodu.net>
Sat, 12 Jan 2008 16:56:05 +0000 (11:56 -0500)
src/obconf.glade
src/strings.c
src/windows.c

index 685ab5f..69f5b8a 100644 (file)
@@ -1286,6 +1286,81 @@ C - The close button</property>
                              <property name="fill">False</property>
                            </packing>
                          </child>
+
+                         <child>
+                           <widget class="GtkHBox" id="hbox107">
+                             <property name="visible">True</property>
+                             <property name="homogeneous">False</property>
+                             <property name="spacing">12</property>
+
+                             <child>
+                               <widget class="GtkLabel" id="label220">
+                                 <property name="visible">True</property>
+                                 <property name="label" translatable="yes">Place new windows _on:</property>
+                                 <property name="use_underline">True</property>
+                                 <property name="use_markup">False</property>
+                                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                                 <property name="wrap">False</property>
+                                 <property name="selectable">False</property>
+                                 <property name="xalign">0</property>
+                                 <property name="yalign">0.5</property>
+                                 <property name="xpad">0</property>
+                                 <property name="ypad">0</property>
+                                 <property name="mnemonic_widget">place_active_popup</property>
+                                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                                 <property name="width_chars">-1</property>
+                                 <property name="single_line_mode">False</property>
+                                 <property name="angle">0</property>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+
+                             <child>
+                               <widget class="GtkOptionMenu" id="place_active_popup">
+                                 <property name="visible">True</property>
+                                 <property name="can_focus">True</property>
+                                 <property name="history">0</property>
+
+                                 <child>
+                                   <widget class="GtkMenu" id="menu13">
+
+                                     <child>
+                                       <widget class="GtkMenuItem" id="menuitem1">
+                                         <property name="visible">True</property>
+                                         <property name="label" translatable="yes">All monitors</property>
+                                         <property name="use_underline">True</property>
+                                         <signal name="activate" handler="on_place_active_popup_all_activate" last_modification_time="Sat, 12 Jan 2008 16:48:17 GMT"/>
+                                       </widget>
+                                     </child>
+
+                                     <child>
+                                       <widget class="GtkMenuItem" id="menuitem2">
+                                         <property name="visible">True</property>
+                                         <property name="label" translatable="yes">The active monitor</property>
+                                         <property name="use_underline">True</property>
+                                         <signal name="activate" handler="on_place_active_popup_active_activate" last_modification_time="Sat, 12 Jan 2008 16:48:08 GMT"/>
+                                       </widget>
+                                     </child>
+                                   </widget>
+                                 </child>
+                               </widget>
+                               <packing>
+                                 <property name="padding">0</property>
+                                 <property name="expand">False</property>
+                                 <property name="fill">False</property>
+                               </packing>
+                             </child>
+                           </widget>
+                           <packing>
+                             <property name="padding">0</property>
+                             <property name="expand">True</property>
+                             <property name="fill">True</property>
+                           </packing>
+                         </child>
                        </widget>
                        <packing>
                          <property name="padding">0</property>
index dbb63d7..ecd2d99 100644 (file)
@@ -39,6 +39,9 @@ gchar *s = N_("<span weight=\"bold\">Placing Windows</span>");
 gchar *s = N_("    ");
 gchar *s = N_("_Place new windows under the mouse pointer");
 gchar *s = N_("_Center new windows when they are placed");
+gchar *s = N_("Place new windows _on:");
+gchar *s = N_("All monitors");
+gchar *s = N_("The active monitor");
 gchar *s = N_("<span weight=\"bold\">Moving and Resizing Windows</span>");
 gchar *s = N_("    ");
 gchar *s = N_("Update the window contents while _resizing");
index 8f9421a..f8d4008 100644 (file)
@@ -29,6 +29,9 @@ static gboolean mapping = FALSE;
 #define POSITION_CENTER 0
 #define POSITION_TOP    1
 
+#define PLACE_ON_ALL    0
+#define PLACE_ON_ACTIVE 1
+
 static void enable_stuff();
 
 void windows_setup_tab()
@@ -83,6 +86,12 @@ void windows_setup_tab()
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                  tree_get_bool("placement/center", TRUE));
 
+    w = get_widget("place_active_popup");
+    if (tree_get_bool("placement/active", FALSE))
+        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ACTIVE);
+    else
+        gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ALL);
+
     w = get_widget("resize_popup");
     s = tree_get_string("resize/popupShow", "NonPixel");
     if (!strcasecmp(s, "Always"))     pos = POPUP_ALWAYS;
@@ -160,6 +169,20 @@ void on_place_center_toggled(GtkToggleButton *w, gpointer data)
     tree_set_bool("placement/center", gtk_toggle_button_get_active(w));
 }
 
+void on_place_active_popup_all_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_bool("placement/active", FALSE);
+}
+
+void on_place_active_popup_active_activate(GtkMenuItem *w, gpointer data)
+{
+    if (mapping) return;
+
+    tree_set_bool("placement/active", TRUE);
+}
+
 void on_resist_window_value_changed(GtkSpinButton *w, gpointer data)
 {
     if (mapping) return;