make the frame window override-redirect

This commit is contained in:
Dana Jansens 2003-01-04 05:18:33 +00:00
parent e3b50c2d13
commit bf404e092b
5 changed files with 14 additions and 14 deletions

View file

@ -1862,7 +1862,7 @@ static PyObject *_wrap_new_OtkWidget__SWIG_1(PyObject *self, PyObject *args) {
int arg3 = (int) otk::OtkWidget::Horizontal ; int arg3 = (int) otk::OtkWidget::Horizontal ;
Cursor arg4 = (Cursor) 0 ; Cursor arg4 = (Cursor) 0 ;
int arg5 = (int) 1 ; int arg5 = (int) 1 ;
unsigned long arg6 = (unsigned long) 0 ; bool arg6 = (bool) false ;
otk::OtkWidget *result; otk::OtkWidget *result;
Cursor *argp4 ; Cursor *argp4 ;
PyObject * obj0 = 0 ; PyObject * obj0 = 0 ;
@ -1878,7 +1878,7 @@ static PyObject *_wrap_new_OtkWidget__SWIG_1(PyObject *self, PyObject *args) {
arg4 = *argp4; arg4 = *argp4;
} }
if (obj5) { if (obj5) {
arg6 = (unsigned long) PyInt_AsLong(obj5); arg6 = (bool) PyInt_AsLong(obj5);
if (PyErr_Occurred()) SWIG_fail; if (PyErr_Occurred()) SWIG_fail;
} }
result = (otk::OtkWidget *)new otk::OtkWidget(arg1,arg2,(otk::OtkWidget::Direction )arg3,arg4,arg5,arg6); result = (otk::OtkWidget *)new otk::OtkWidget(arg1,arg2,(otk::OtkWidget::Direction )arg3,arg4,arg5,arg6);

View file

@ -35,7 +35,7 @@ OtkWidget::OtkWidget(OtkWidget *parent, Direction direction)
OtkWidget::OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style, 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) bool override_redirect)
: OtkEventHandler(), : OtkEventHandler(),
_dirty(false),_focused(false), _dirty(false),_focused(false),
_parent(0), _style(style), _direction(direction), _cursor(cursor), _parent(0), _style(style), _direction(direction), _cursor(cursor),
@ -48,7 +48,7 @@ OtkWidget::OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style,
{ {
assert(event_dispatcher); assert(event_dispatcher);
assert(style); assert(style);
create(create_mask); create(override_redirect);
_event_dispatcher->registerHandler(_window, this); _event_dispatcher->registerHandler(_window, this);
setStyle(_style); // let the widget initialize stuff setStyle(_style); // let the widget initialize stuff
} }
@ -68,7 +68,7 @@ OtkWidget::~OtkWidget()
XDestroyWindow(otk::OBDisplay::display, _window); XDestroyWindow(otk::OBDisplay::display, _window);
} }
void OtkWidget::create(unsigned long mask) void OtkWidget::create(bool override_redirect)
{ {
const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen); const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen);
Window p_window = _parent ? _parent->window() : scr_info->rootWindow(); Window p_window = _parent ? _parent->window() : scr_info->rootWindow();
@ -76,15 +76,17 @@ void OtkWidget::create(unsigned long mask)
_rect.setRect(0, 0, 1, 1); // just some initial values _rect.setRect(0, 0, 1, 1); // just some initial values
XSetWindowAttributes attrib_create; 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.background_pixmap = None;
attrib_create.colormap = scr_info->colormap(); attrib_create.colormap = scr_info->colormap();
attrib_create.override_redirect = true; // not used by default
attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask | attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | ExposureMask | StructureNotifyMask; ButtonMotionMask | ExposureMask | StructureNotifyMask;
if (override_redirect) {
create_mask |= CWOverrideRedirect;
attrib_create.override_redirect = true;
}
if (_cursor) { if (_cursor) {
create_mask |= CWCursor; create_mask |= CWCursor;

View file

@ -28,7 +28,7 @@ public:
OtkWidget(otk::OtkWidget *parent, Direction = Horizontal); OtkWidget(otk::OtkWidget *parent, Direction = Horizontal);
OtkWidget(otk::OtkEventDispatcher *event_dispatcher, otk::Style *style, OtkWidget(otk::OtkEventDispatcher *event_dispatcher, otk::Style *style,
Direction direction = Horizontal, Cursor cursor = 0, Direction direction = Horizontal, Cursor cursor = 0,
int bevel_width = 1, unsigned long create_mask = 0); int bevel_width = 1, bool override_redirect = false);
virtual ~OtkWidget(); virtual ~OtkWidget();
@ -126,7 +126,7 @@ protected:
bool _focused; bool _focused;
virtual void adjust(void); virtual void adjust(void);
virtual void create(unsigned long mask = 0); virtual void create(bool override_redirect = false);
virtual void adjustHorz(void); virtual void adjustHorz(void);
virtual void adjustVert(void); virtual void adjustVert(void);
virtual void internalResize(int width, int height); virtual void internalResize(int width, int height);

View file

@ -24,8 +24,7 @@ namespace ob {
const long OBFrame::event_mask; const long OBFrame::event_mask;
OBFrame::OBFrame(OBClient *client, otk::Style *style) OBFrame::OBFrame(OBClient *client, otk::Style *style)
: otk::OtkWidget(Openbox::instance, style, Horizontal, 0, 1, : otk::OtkWidget(Openbox::instance, style, Horizontal, 0, 1, true),
CWOverrideRedirect),
OBWidget(Type_Frame), OBWidget(Type_Frame),
_client(client), _client(client),
_screen(otk::OBDisplay::screenInfo(client->screen())), _screen(otk::OBDisplay::screenInfo(client->screen())),
@ -106,7 +105,6 @@ void OBFrame::focus()
{ {
otk::OtkWidget::focus(); otk::OtkWidget::focus();
update(); update();
_handle.update();
} }

View file

@ -34,7 +34,7 @@ public:
//! The event mask to grab on frame windows //! The event mask to grab on frame windows
static const long event_mask = EnterWindowMask | LeaveWindowMask; static const long event_mask = EnterWindowMask | LeaveWindowMask;
private: private:
OBClient *_client; OBClient *_client;
const otk::ScreenInfo *_screen; const otk::ScreenInfo *_screen;