completely netwm using now! yay. next stop: configure mouse button actions or maybe...
authorMikael Magnusson <mikachu@comhem.se>
Sat, 2 Jun 2007 00:08:55 +0000 (00:08 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Sat, 2 Jun 2007 00:08:55 +0000 (00:08 +0000)
rspanel.c

index d487935..3a5199a 100644 (file)
--- a/rspanel.c
+++ b/rspanel.c
@@ -751,6 +751,7 @@ void draw_grill(int x)
     }
 }
 
+#ifdef MIKACHU //this only works in mikabox
 void ob_action(Window win, char *action)
 {
     XClientMessageEvent xev;
@@ -765,7 +766,7 @@ void ob_action(Window win, char *action)
     xev.data.l[0] = XInternAtom(dd, act_name, False);
     XSendEvent(dd, root_win, False, SubstructureRedirectMask, (XEvent *)&xev);
 }
-
+#endif
 void netwm_action(Window win, atom_t atom, Time time, long l)
 {
     XClientMessageEvent xev = {
@@ -1045,7 +1046,8 @@ void handle_press(int x, int y, int button, Time time)
                 switch (button) {
                     case 1:
                         if (tk->iconified && tk->shaded)
-                            ob_action(tk->win, "unshade");
+//                            ob_action(tk->win, "unshade");
+// probably not needed        netwm_action(tk->win, _NET_WM_STATE_SHADED, time, REMOVE);
                         //ob_action(tk->win, "activate");
                         netwm_action(tk->win, _NET_ACTIVE_WINDOW, time, 0);
                         break;
@@ -1058,7 +1060,8 @@ void handle_press(int x, int y, int button, Time time)
                             //ob_action(tk->win, "iconify");
                         break;
                     case 3:
-                        ob_action(tk->win, "raiselower");
+                        netwm_action(tk->win, _NET_RESTACK_WINDOW, time, Opposite);
+                        //ob_action(tk->win, "raiselower");
                         break;
                     case 4:
                         if (is_shaded(tk->win))
@@ -1076,8 +1079,10 @@ void handle_press(int x, int y, int button, Time time)
                         if (tk->iconified)
                             netwm_action(tk->win, _NET_WM_STATE_HIDDEN, time, REMOVE);
                             //ob_action(tk->win, "deiconify");
+#ifdef MIKACHU //this doesn't work for anyone else anyway
                         else
                             ob_action(tk->win, "focus");
+#endif
                         break;
                     case 6:
 //                        ob_action(tk->win, "lower");
@@ -1094,13 +1099,16 @@ void handle_press(int x, int y, int button, Time time)
         } /* clicked on the background */
         switch (button) {
             case 1:
-                ob_action(tb.win, "raise");
+                netwm_action(tb.win, _NET_RESTACK_WINDOW, time, Above);
+                //ob_action(tb.win, "raise");
                 break;
             case 2:
-                ob_action(tb.win, "lower");
+                netwm_action(tb.win, _NET_RESTACK_WINDOW, time, Below);
+//                ob_action(tb.win, "lower");
                 break;
             case 3:
-                ob_action(tb.win, "raiselower");
+                netwm_action(tb.win, _NET_RESTACK_WINDOW, time, Opposite);
+//                ob_action(tb.win, "raiselower");
                 break;
             case 4:
                 tb.hidden = 1;