aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/GContext.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-09 01:19:48 (GMT)
committerfluxgen <fluxgen>2004-01-09 01:19:48 (GMT)
commit08f6ca0514de8e24fb98e6a8b057598fc70ebd64 (patch)
treedcd547fac4692b721e9b6c6817caea83eef3595c /src/FbTk/GContext.cc
parenta48d734251fd8ee0aec24c7e295bcbc2a3e1a188 (diff)
downloadfluxbox_pavel-08f6ca0514de8e24fb98e6a8b057598fc70ebd64.zip
fluxbox_pavel-08f6ca0514de8e24fb98e6a8b057598fc70ebd64.tar.bz2
save some memory
Diffstat (limited to 'src/FbTk/GContext.cc')
-rw-r--r--src/FbTk/GContext.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/FbTk/GContext.cc b/src/FbTk/GContext.cc
index e0f66a4..dae8fac 100644
--- a/src/FbTk/GContext.cc
+++ b/src/FbTk/GContext.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: GContext.cc,v 1.5 2003/11/28 22:50:55 fluxgen Exp $ 22// $Id: GContext.cc,v 1.6 2004/01/09 01:19:48 fluxgen Exp $
23 23
24#include "GContext.hh" 24#include "GContext.hh"
25 25
@@ -31,27 +31,33 @@
31 31
32namespace FbTk { 32namespace FbTk {
33 33
34Display *GContext::m_display = 0;
35
34GContext::GContext(const FbTk::FbDrawable &drawable): 36GContext::GContext(const FbTk::FbDrawable &drawable):
35 m_display(FbTk::App::instance()->display()), 37 m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
36 m_gc(XCreateGC(m_display,
37 drawable.drawable(), 38 drawable.drawable(),
38 0, 0)) { 39 0, 0)) {
40 if (m_display == 0)
41 m_display = FbTk::App::instance()->display();
42
39 setGraphicsExposure(false); 43 setGraphicsExposure(false);
40} 44}
41 45
42GContext::GContext(Drawable drawable): 46GContext::GContext(Drawable drawable):
43 m_display(FbTk::App::instance()->display()), 47 m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
44 m_gc(XCreateGC(m_display,
45 drawable, 48 drawable,
46 0, 0)) { 49 0, 0)) {
50 if (m_display == 0)
51 m_display = FbTk::App::instance()->display();
47 setGraphicsExposure(false); 52 setGraphicsExposure(false);
48} 53}
49 54
50GContext::GContext(Drawable d, const GContext &gc): 55GContext::GContext(Drawable d, const GContext &gc):
51 m_display(FbTk::App::instance()->display()), 56 m_gc(XCreateGC(m_display != 0 ? m_display : FbTk::App::instance()->display(),
52 m_gc(XCreateGC(m_display,
53 d, 57 d,
54 0, 0)) { 58 0, 0)) {
59 if (m_display == 0)
60 m_display = FbTk::App::instance()->display();
55 setGraphicsExposure(false); 61 setGraphicsExposure(false);
56 copy(gc); 62 copy(gc);
57} 63}