Allow running fluid -c without opening the X11 display.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-03-01 20:44:56 +00:00
parent a3d54d5d6c
commit 9c77129a28
3 changed files with 10 additions and 6 deletions

View File

@ -689,6 +689,9 @@ void fl_open_display() {
if (!d) Fl::fatal("Can't open display: %s",XDisplayName(0));
fl_open_display(d);
// the unique GC used by all X windows
GC gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
Fl_Display_Device::display_device()->driver()->gc(gc);
}

View File

@ -42,6 +42,7 @@ public:
Fl_Xlib_Graphics_Driver(void);
virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
virtual void *gc() { return gc_; }
virtual void gc(void *value);
char can_do_alpha_blending();
// --- bitmap stuff

View File

@ -50,15 +50,15 @@ Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver()
GC Fl_Xlib_Graphics_Driver::gc_ = NULL;
Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
if (!gc_) {
fl_open_display();
// the unique GC used by all X windows
gc_ = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
fl_gc = gc_;
}
mask_bitmap_ = NULL;
}
void Fl_Xlib_Graphics_Driver::gc(void *value) {
gc_ = (GC)value;
fl_gc = gc_;
}
char Fl_Xlib_Graphics_Driver::can_do_alpha_blending() {
return Fl_X::xrender_supported();
}