]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/frame-pointer.c
Imported Upstream version 20090110
[ion3.git] / ioncore / frame-pointer.c
index 1d9a1968c2f9bc9453e3cb6668beff5219309abb..6340dd0d2ccfebdd692bcf999bce243f46565ab6 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/ioncore/frame-pointer.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * Copyright (c) Tuomo Valkonen 1999-2009
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <string.h>
@@ -66,7 +63,8 @@ int frame_press(WFrame *frame, XButtonEvent *ev, WRegion **reg_ret)
         g.y=0;
     }
 
-    if(rectangle_contains(&g, ev->x, ev->y)){
+    if(frame->barmode!=FRAME_BAR_NONE && 
+       rectangle_contains(&g, ev->x, ev->y)){
         p_tabnum=frame_tab_at_x(frame, ev->x);
 
         region_rootpos((WRegion*)frame, &p_tab_x, &p_tab_y);
@@ -138,7 +136,7 @@ static bool tabdrag_kbd_handler(WRegion *reg, XEvent *xev)
     
     assert(reg!=NULL);
 
-    binding=bindmap_lookup_binding(ioncore_rootwin_bindmap, BINDING_KEYPRESS,
+    binding=bindmap_lookup_binding(ioncore_screen_bindmap, BINDING_KEYPRESS,
                                    ev->state&~BUTTONS_MASK, ev->keycode);
     
     if(binding!=NULL && binding->func!=extl_fn_none()){
@@ -173,9 +171,7 @@ static void setup_dragwin(WFrame *frame, uint tab)
     if(tabdrag_infowin==NULL)
         return;
     
-    infowin_set_attr2(tabdrag_infowin, (REGION_IS_ACTIVE(frame) 
-                                        ? "active" : "inactive"),
-                      frame->titles[tab].attr);
+    frame_setup_dragwin_style(frame, infowin_stylespec(tabdrag_infowin), tab);
     
     if(frame->titles[tab].text!=NULL){
         char *buf=INFOWIN_BUFFER(tabdrag_infowin);
@@ -338,7 +334,7 @@ static void p_tabdrag_end(WFrame *frame, XButtonEvent *ev)
 /*EXTL_DOC
  * Start dragging the tab that the user pressed on with the pointing device.
  * This function should only be used by binding it to \emph{mpress} or
- * \emph{mdrag} action with area ''tab''.
+ * \emph{mdrag} action with area \codestr{tab}.
  */
 EXTL_EXPORT_MEMBER
 void frame_p_tabdrag(WFrame *frame)
@@ -368,19 +364,22 @@ void frame_p_tabdrag(WFrame *frame)
 EXTL_EXPORT_MEMBER
 void frame_p_switch_tab(WFrame *frame)
 {
-    WRegion *sub;
+    /*WRegion *sub;*/
     
     if(ioncore_pointer_grab_region()!=(WRegion*)frame)
         return;
     
+    /*
     sub=sub_at_tab(frame);
-    
     if(sub!=NULL){
         bool mcf=region_may_control_focus((WRegion*)frame);
         region_goto_flags(sub, (mcf 
                                 ? REGION_GOTO_FOCUS|REGION_GOTO_NOWARP 
                                 : 0));
     }
+    */
+    
+    mplex_switch_nth((WMPlex*)frame, p_tabnum);
 }