]> Dogcows Code - chaz/openbox/commitdiff
add an option to resize with 4 corners as it was long ago and make the default 9...
authorMikael Magnusson <mikachu@comhem.se>
Thu, 4 Nov 2004 12:13:25 +0000 (12:13 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 4 Nov 2004 12:13:25 +0000 (12:13 +0000)
data/rc.xml.in
data/rc.xsd
openbox/action.c
openbox/config.c
openbox/config.h

index b07a8cdce3362edd17910cf4613b371d88ba3a48..62ded70c56ff7fb6c38eb5ae6d04516d444b21d1 100644 (file)
@@ -44,6 +44,7 @@
 
 <resize>
   <drawContents>yes</drawContents>
+  <fourCorners>no</fourCorners>
 </resize>
 
 <dock>
index b5b40f2da13bdea10e8cea244f55168984de4805..521fe0c287d75315c5cabb5d2aeebcc73e171bbd 100644 (file)
@@ -31,6 +31,8 @@
      Sun Oct 31 10:08:34 UTC 2004 - mikachu(a)openbox.org
          we haven't remembered to update this changelog in a while,
          adding desktopMenuIcons.
+     Thu Nov  4 12:07:08 UTC 2004 - mikachu(a)openbox.org
+         Add fourCorners to resize context.
 -->
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://openbox.org/"
     <xs:complexType name="resize">
         <xs:sequence>
             <xs:element name="drawContents" type="ob:yesorno"/>
+            <xs:element name="fourCorners" type="ob:yesorno"/>
             <xs:element name="popupShow" type="ob:popupshow"/>
             <xs:element name="popupPosition" type="ob:popupposition"/>
         </xs:sequence>
index bd8ae9e40fd9192706c51ec9f8347274088cea19..a6323d6f636a1cd7672978281e2369f0f6ab3ea4 100644 (file)
@@ -1344,25 +1344,40 @@ void action_toggle_decorations(union ActionData *data)
 
 static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch)
 {
-    if ((cw / 3 < 1) || (x - cx > cw / 3 * 2)) {
-        if ((ch / 3 < 1) || (y - cy > ch / 3 * 2))
-            return prop_atoms.net_wm_moveresize_size_bottomright;
-        else if (y - cy < ch / 3)
-            return prop_atoms.net_wm_moveresize_size_topright;
-        else
-            return prop_atoms.net_wm_moveresize_size_right;
-    } else if (x - cx < cw / 3) {
-        if (y - cy > ch / 3 * 2)
-            return prop_atoms.net_wm_moveresize_size_bottomleft;
-        else if (y - cy < ch / 3)
-            return prop_atoms.net_wm_moveresize_size_topleft;
-        else
-            return prop_atoms.net_wm_moveresize_size_left;
+    if (config_resize_four_corners) {
+        if (x - cx > cw / 2) {
+            if (y - cy > ch / 2)
+                return prop_atoms.net_wm_moveresize_size_bottomright;
+            else
+                return prop_atoms.net_wm_moveresize_size_topright;
+        } else {
+            if (y - cy > ch / 2)
+                return prop_atoms.net_wm_moveresize_size_bottomleft;
+            else
+                return prop_atoms.net_wm_moveresize_size_topleft;
+        }
     } else {
-        if (y - cy > ch / 2)
-            return prop_atoms.net_wm_moveresize_size_bottom;
-        else
-            return prop_atoms.net_wm_moveresize_size_top;
+        if (x - cx > cw * 2 / 3) {
+            if (y - cy > ch * 2 / 3)
+                return prop_atoms.net_wm_moveresize_size_bottomright;
+            else if (y - cy < ch / 3)
+                return prop_atoms.net_wm_moveresize_size_topright;
+            else
+                return prop_atoms.net_wm_moveresize_size_right;
+        } else if (x - cx < cw / 3) {
+            if (y - cy > ch * 2 / 3)
+                return prop_atoms.net_wm_moveresize_size_bottomleft;
+            else if (y - cy < ch / 3)
+                return prop_atoms.net_wm_moveresize_size_topleft;
+            else
+                return prop_atoms.net_wm_moveresize_size_left;
+        } else
+            if (y - cy > ch * 2 / 3)
+                return prop_atoms.net_wm_moveresize_size_bottom;
+            else if (y - cy < ch / 3)
+                return prop_atoms.net_wm_moveresize_size_top;
+            else
+                return prop_atoms.net_wm_moveresize_move;
     }
 }
 
index 4dac22d8ce902bca6961acf15c88881099116c0d..cc44e129ac7e113e04fb9830935c60466a0ed132 100644 (file)
@@ -43,6 +43,7 @@ GSList *config_desktops_names;
 gint    config_screen_firstdesk;
 
 gboolean config_resize_redraw;
+gboolean config_resize_four_corners;
 gint     config_resize_popup_show;
 gint     config_resize_popup_pos;
 
@@ -300,6 +301,8 @@ static void parse_resize(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
     
     if ((n = parse_find_node("drawContents", node)))
         config_resize_redraw = parse_bool(doc, n);
+    if ((n = parse_find_node("fourCorner", node)))
+        config_resize_four_corners = parse_bool(doc, n);
     if ((n = parse_find_node("popupShow", node))) {
         config_resize_popup_show = parse_int(doc, n);
         if (parse_contains("Always", doc, n))
@@ -559,6 +562,7 @@ void config_startup(ObParseInst *i)
     parse_register(i, "desktops", parse_desktops, NULL);
 
     config_resize_redraw = TRUE;
+    config_resize_four_corners = FALSE;
     config_resize_popup_show = 1; /* nonpixel increments */
     config_resize_popup_pos = 0;  /* center of client */
 
index 13255108b138d417c27769823d1ffe974da4ce22..d7fc51f74a0ad1b85d97e33ac376bdc88c6e342e 100644 (file)
@@ -45,6 +45,9 @@ extern ObPlacePolicy config_place_policy;
 /*! When true windows' contents are refreshed while they are resized; otherwise
   they are not updated until the resize is complete */
 extern gboolean config_resize_redraw;
+/*! Divide windows in 4 or 9 areas when doing a resize. The middle will be move
+  when selecting 9 corners */
+extern gboolean config_resize_four_corners;
 /*! show move/resize popups? 0 = no, 1 = always, 2 = only
   resizing !1 increments */
 extern gint config_resize_popup_show;
This page took 0.034681 seconds and 4 git commands to generate.