~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: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: GHOST_WindowX11.cpp,v 1.10 2004/02/23 14:10:00 sirdude Exp $
 
2
 * $Id: GHOST_WindowX11.cpp,v 1.13 2004/12/04 00:12:53 blendix Exp $
3
3
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
68
68
        GHOST_TDrawingContextType type,
69
69
        const bool stereoVisual
70
70
) :
71
 
        GHOST_Window(title,left,top,width,height,state,type),
 
71
        GHOST_Window(title,left,top,width,height,state,type,stereoVisual),
72
72
        m_display(display),
73
73
        m_valid_setup (false),
74
74
        m_system (system),
390
390
 
391
391
}
392
392
 
 
393
#include <iostream>
 
394
using namespace std;
 
395
 
393
396
        GHOST_TSuccess 
394
397
GHOST_WindowX11::
395
398
setOrder(
397
400
){
398
401
        if (order == GHOST_kWindowOrderTop) {
399
402
                XWindowAttributes attr;   
400
 
 
401
 
                XRaiseWindow(m_display,m_window);
 
403
                Atom atom;
 
404
 
 
405
                /* We use both XRaiseWindow and _NET_ACTIVE_WINDOW, since some
 
406
                   window managers ignore the former (e.g. kwin from kde) and others
 
407
                   don't implement the latter (e.g. fluxbox pre 0.9.9) */
 
408
 
 
409
                XRaiseWindow(m_display, m_window);
 
410
 
 
411
                atom = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", True);
 
412
 
 
413
                if (atom != None) {
 
414
                        Window root;
 
415
                        XEvent xev;
 
416
                        long eventmask;
 
417
 
 
418
                        xev.xclient.type = ClientMessage;
 
419
                        xev.xclient.serial = 0;
 
420
                        xev.xclient.send_event = True;
 
421
                        xev.xclient.window = m_window;
 
422
                        xev.xclient.message_type = atom;
 
423
 
 
424
                        xev.xclient.format = 32;
 
425
                        xev.xclient.data.l[0] = 0;
 
426
                        xev.xclient.data.l[1] = 0;
 
427
                        xev.xclient.data.l[2] = 0;
 
428
                        xev.xclient.data.l[3] = 0;
 
429
                        xev.xclient.data.l[4] = 0;
 
430
 
 
431
                        root = RootWindow(m_display, m_visual->screen),
 
432
                        eventmask = SubstructureRedirectMask | SubstructureNotifyMask;
 
433
 
 
434
                        XSendEvent(m_display, root, False, eventmask, &xev);
 
435
                }
402
436
 
403
437
                XGetWindowAttributes(m_display, m_window, &attr);
404
438