~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to intern/ghost/intern/GHOST_WindowX11.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: GHOST_WindowX11.cpp,v 1.17 2006/11/11 22:47:41 blendix Exp $
 
2
 * $Id: GHOST_WindowX11.cpp,v 1.19 2007/04/15 06:02:12 campbellbarton Exp $
3
3
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
36
36
 
37
37
// For standard X11 cursors
38
38
#include <X11/cursorfont.h>
 
39
#include <X11/Xatom.h>
39
40
 
40
41
// For obscure full screen mode stuuf
41
42
// lifted verbatim from blut.
65
66
        const bool stereoVisual
66
67
) :
67
68
        GHOST_Window(title,left,top,width,height,state,type,stereoVisual),
 
69
        m_context(NULL),
68
70
        m_display(display),
 
71
        m_system (system),
69
72
        m_valid_setup (false),
70
 
        m_system (system),
71
73
        m_invalid_window(false),
72
 
        m_context(NULL),
73
74
        m_empty_cursor(None),
74
75
        m_custom_cursor(None)
75
76
{
163
164
                        XChangeProperty(m_display, m_window,
164
165
                                atom, atom, 32,
165
166
                                PropModeReplace, (unsigned char *) &hints, 4);
166
 
                }               
167
 
        }
 
167
                }
 
168
        } else if (state == GHOST_kWindowStateMaximized) {
 
169
                // With this, xprop should report the following just after launch
 
170
                // _NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ
 
171
                // After demaximization the right side is empty, though (maybe not the most correct then?)
 
172
                Atom state, atomh, atomv;
168
173
 
 
174
                state = XInternAtom(m_display, "_NET_WM_STATE", False);
 
175
                atomh = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
 
176
                atomv = XInternAtom(m_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
 
177
                if (state == None ) {
 
178
                        GHOST_PRINT("Atom _NET_WM_STATE requested but not avaliable nor created.\n");
 
179
                } else {
 
180
                        XChangeProperty(m_display, m_window,
 
181
                                state, XA_ATOM, 32,
 
182
                                PropModeAppend, (unsigned char *) &atomh, 1);
 
183
                        XChangeProperty(m_display, m_window,
 
184
                                state, XA_ATOM, 32,
 
185
                                PropModeAppend, (unsigned char *) &atomv, 1);
 
186
                }
 
187
        }
 
188
        
169
189
        // Create some hints for the window manager on how
170
190
        // we want this window treated. 
171
191
 
476
496
){
477
497
        //TODO
478
498
 
479
 
        if (state == getState()) {
 
499
        if (state == (int)getState()) {
480
500
                return GHOST_kSuccess;
481
501
        } else {
482
502
                return GHOST_kFailure;