]> Dogcows Code - chaz/openbox/commitdiff
make the frame window override-redirect
authorDana Jansens <danakj@orodu.net>
Sat, 4 Jan 2003 04:49:53 +0000 (04:49 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 4 Jan 2003 04:49:53 +0000 (04:49 +0000)
otk/otk_wrap.cc
otk/widget.cc
otk/widget.hh
src/frame.cc
src/frame.hh

index dc8db8e712394ea77a11f56a3d2fd8acba13237c..8b072b3082aaa08da50dc0e89c70fad2f8491ca1 100644 (file)
@@ -1862,20 +1862,26 @@ static PyObject *_wrap_new_OtkWidget__SWIG_1(PyObject *self, PyObject *args) {
     int arg3 = (int) otk::OtkWidget::Horizontal ;
     Cursor arg4 = (Cursor) 0 ;
     int arg5 = (int) 1 ;
+    unsigned long arg6 = (unsigned long) 0 ;
     otk::OtkWidget *result;
     Cursor *argp4 ;
     PyObject * obj0  = 0 ;
     PyObject * obj1  = 0 ;
     PyObject * obj3  = 0 ;
+    PyObject * obj5  = 0 ;
     
-    if(!PyArg_ParseTuple(args,(char *)"OO|iOi:new_OtkWidget",&obj0,&obj1,&arg3,&obj3,&arg5)) goto fail;
+    if(!PyArg_ParseTuple(args,(char *)"OO|iOiO:new_OtkWidget",&obj0,&obj1,&arg3,&obj3,&arg5,&obj5)) goto fail;
     if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__OtkEventDispatcher,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
     if (obj3) {
         if ((SWIG_ConvertPtr(obj3,(void **) &argp4, SWIGTYPE_p_Cursor,SWIG_POINTER_EXCEPTION) == -1)) SWIG_fail;
         arg4 = *argp4; 
     }
-    result = (otk::OtkWidget *)new otk::OtkWidget(arg1,arg2,(otk::OtkWidget::Direction )arg3,arg4,arg5);
+    if (obj5) {
+        arg6 = (unsigned long) PyInt_AsLong(obj5);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    result = (otk::OtkWidget *)new otk::OtkWidget(arg1,arg2,(otk::OtkWidget::Direction )arg3,arg4,arg5,arg6);
     
     resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__OtkWidget, 1);
     return resultobj;
@@ -1886,11 +1892,11 @@ static PyObject *_wrap_new_OtkWidget__SWIG_1(PyObject *self, PyObject *args) {
 
 static PyObject *_wrap_new_OtkWidget(PyObject *self, PyObject *args) {
     int argc;
-    PyObject *argv[6];
+    PyObject *argv[7];
     int ii;
     
     argc = PyObject_Length(args);
-    for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+    for (ii = 0; (ii < argc) && (ii < 6); ii++) {
         argv[ii] = PyTuple_GetItem(args,ii);
     }
     if ((argc >= 1) && (argc <= 2)) {
@@ -1916,7 +1922,7 @@ static PyObject *_wrap_new_OtkWidget(PyObject *self, PyObject *args) {
             }
         }
     }
-    if ((argc >= 2) && (argc <= 5)) {
+    if ((argc >= 2) && (argc <= 6)) {
         int _v;
         {
             void *ptr;
@@ -1965,7 +1971,15 @@ static PyObject *_wrap_new_OtkWidget(PyObject *self, PyObject *args) {
                             _v = (PyInt_Check(argv[4]) || PyLong_Check(argv[4])) ? 1 : 0;
                         }
                         if (_v) {
-                            return _wrap_new_OtkWidget__SWIG_1(self,args);
+                            if (argc <= 5) {
+                                return _wrap_new_OtkWidget__SWIG_1(self,args);
+                            }
+                            {
+                                _v = (PyInt_Check(argv[5]) || PyLong_Check(argv[5])) ? 1 : 0;
+                            }
+                            if (_v) {
+                                return _wrap_new_OtkWidget__SWIG_1(self,args);
+                            }
                         }
                     }
                 }
index 161e3e71d6523c5b014136944bc2937c183895de..6987ee592e72227ad9ce98906c785daa61800e2b 100644 (file)
@@ -34,7 +34,8 @@ OtkWidget::OtkWidget(OtkWidget *parent, Direction direction)
 }
 
 OtkWidget::OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style,
-                     Direction direction, Cursor cursor, int bevel_width)
+                     Direction direction, Cursor cursor, int bevel_width,
+                     unsigned long create_mask)
   : OtkEventHandler(),
     _dirty(false),_focused(false),
     _parent(0), _style(style), _direction(direction), _cursor(cursor),
@@ -47,7 +48,7 @@ OtkWidget::OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style,
 {
   assert(event_dispatcher);
   assert(style);
-  create();
+  create(create_mask);
   _event_dispatcher->registerHandler(_window, this);
   setStyle(_style); // let the widget initialize stuff
 }
@@ -67,7 +68,7 @@ OtkWidget::~OtkWidget()
   XDestroyWindow(otk::OBDisplay::display, _window);
 }
 
-void OtkWidget::create(void)
+void OtkWidget::create(unsigned long mask)
 {
   const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen);
   Window p_window = _parent ? _parent->window() : scr_info->rootWindow();
@@ -75,13 +76,16 @@ void OtkWidget::create(void)
   _rect.setRect(0, 0, 1, 1); // just some initial values
 
   XSetWindowAttributes attrib_create;
-  unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask;
+  unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask |
+                              mask;
 
   attrib_create.background_pixmap = None;
   attrib_create.colormap = scr_info->colormap();
+  attrib_create.override_redirect = True; // not used by default
   attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
     ButtonMotionMask | ExposureMask | StructureNotifyMask;
 
+
   if (_cursor) {
     create_mask |= CWCursor;
     attrib_create.cursor = _cursor;
index 7c508fcdf445626c71c494b641a7ae3fea3433e6..8d3bfb2308344262b793c4908d084763536ab894 100644 (file)
@@ -28,7 +28,7 @@ public:
   OtkWidget(otk::OtkWidget *parent, Direction = Horizontal);
   OtkWidget(otk::OtkEventDispatcher *event_dispatcher, otk::Style *style,
             Direction direction = Horizontal, Cursor cursor = 0,
-            int bevel_width = 1);
+            int bevel_width = 1, unsigned long create_mask = 0);
 
   virtual ~OtkWidget();
 
@@ -126,7 +126,7 @@ protected:
   bool _focused;
 
   virtual void adjust(void);
-  virtual void create(void);
+  virtual void create(unsigned long mask = 0);
   virtual void adjustHorz(void);
   virtual void adjustVert(void);
   virtual void internalResize(int width, int height);
index ee770b25375b54eba9d1ebb25629424dfd4ff1f6..dc126ea3b8f43d3dfe32f71d46c7ddc13b9ac251 100644 (file)
@@ -24,7 +24,8 @@ namespace ob {
 const long OBFrame::event_mask;
 
 OBFrame::OBFrame(OBClient *client, otk::Style *style)
-  : otk::OtkWidget(Openbox::instance, style),
+  : otk::OtkWidget(Openbox::instance, style, Horizontal, 0, 1,
+                   CWOverrideRedirect),
     OBWidget(Type_Frame),
     _client(client),
     _screen(otk::OBDisplay::screenInfo(client->screen())),
@@ -43,8 +44,8 @@ OBFrame::OBFrame(OBClient *client, otk::Style *style)
   assert(client);
   assert(style);
 
-  XSelectInput(otk::OBDisplay::display, window(), OBFrame::event_mask);
-  
+  XSelectInput(otk::OBDisplay::display, _window, OBFrame::event_mask);
+
   _grip_left.setCursor(Openbox::instance->cursors().ll_angle);
   _grip_right.setCursor(Openbox::instance->cursors().lr_angle);
   
index ab1e1b0347eb5c82e4a90fa42cfbc5bc453e76fb..e7a552375f499de3eb9042989fcfd9a37ff5fc02 100644 (file)
@@ -33,9 +33,7 @@ class OBFrame : public otk::OtkWidget, public OBWidget {
 public:
 
   //! The event mask to grab on frame windows
-  static const long event_mask = EnterWindowMask | LeaveWindowMask |
-                                 ButtonPressMask | ButtonReleaseMask |
-                                 ButtonMotionMask;
+  static const long event_mask = EnterWindowMask | LeaveWindowMask;
 
 private:
   OBClient *_client;
This page took 0.043454 seconds and 4 git commands to generate.