]> git.saurik.com Git - wxWidgets.git/blame - src/x11/dcscreen.cpp
revert nested event loop support for wxGTK1 because it causes applications hangs
[wxWidgets.git] / src / x11 / dcscreen.cpp
CommitLineData
83df96d6 1/////////////////////////////////////////////////////////////////////////////
670f9935 2// Name: src/x11/dcscreen.cpp
83df96d6 3// Purpose: wxScreenDC class
3cd0b8c5 4// Author: Julian Smart, Robert Roebling
83df96d6
JS
5// Modified by:
6// Created: 17/09/98
3cd0b8c5 7// Copyright: (c) Julian Smart, Robert Roebling
670f9935 8// Licence: wxWindows licence
83df96d6
JS
9/////////////////////////////////////////////////////////////////////////////
10
670f9935
WS
11// for compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#include "wx/dcscreen.h"
e6514d0e 15#include "wx/x11/dcscreen.h"
670f9935
WS
16
17#ifndef WX_PRECOMP
18 #include "wx/app.h"
de6185e2 19 #include "wx/utils.h"
cdccdfab 20 #include "wx/window.h"
76b49cf4 21 #include "wx/frame.h"
670f9935
WS
22#endif
23
2b5f62a0 24#include "wx/fontutil.h"
83df96d6 25
bc797f4c 26#include "wx/x11/private.h"
83df96d6 27
3cd0b8c5
RR
28//-----------------------------------------------------------------------------
29// wxScreenDC
30//-----------------------------------------------------------------------------
31
e6514d0e 32IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl,wxPaintDCImpl)
3cd0b8c5 33
f95b06a6
VZ
34wxScreenDCImpl::wxScreenDCImpl( wxDC* owner )
35 : wxPaintDCImpl( owner )
83df96d6 36{
670f9935
WS
37 m_ok = false;
38
3cd0b8c5 39 m_display = (WXDisplay *) wxGlobalDisplay();
670f9935 40
3cd0b8c5
RR
41 int screen = DefaultScreen( (Display*) m_display );
42 m_cmap = (WXColormap) DefaultColormap( (Display*) m_display, screen );
670f9935 43
e6514d0e 44 m_x11window = (WXWindow) RootWindow( (Display*) m_display, screen );
3cd0b8c5 45
670f9935 46 m_isScreenDC = true;
3cd0b8c5 47
2b5f62a0
VZ
48#if wxUSE_UNICODE
49 m_context = wxTheApp->GetPangoContext();
50 m_fontdesc = wxNORMAL_FONT->GetNativeFontInfo()->description;
51#endif
52
3cd0b8c5
RR
53 SetUpDC();
54
55 XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, IncludeInferiors );
56 XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, IncludeInferiors );
57 XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, IncludeInferiors );
58 XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, IncludeInferiors );
83df96d6
JS
59}
60
e6514d0e 61wxScreenDCImpl::~wxScreenDCImpl()
83df96d6 62{
3cd0b8c5
RR
63 XSetSubwindowMode( (Display*) m_display, (GC) m_penGC, ClipByChildren );
64 XSetSubwindowMode( (Display*) m_display, (GC) m_brushGC, ClipByChildren );
65 XSetSubwindowMode( (Display*) m_display, (GC) m_textGC, ClipByChildren );
66 XSetSubwindowMode( (Display*) m_display, (GC) m_bgGC, ClipByChildren );
83df96d6
JS
67}
68
f95b06a6
VZ
69void wxScreenDCImpl::DoGetSize(int *width, int *height) const
70{
71 wxDisplaySize(width, height);
72}