diff --git a/uppsrc/CtrlCore/X11App.cpp b/uppsrc/CtrlCore/X11App.cpp index 8ee363e8d..123040ed2 100644 --- a/uppsrc/CtrlCore/X11App.cpp +++ b/uppsrc/CtrlCore/X11App.cpp @@ -17,7 +17,7 @@ Atom XAtomRaw(const char *name) Atom XAtom(const char *name) { - GuiLock __; + GuiLock __; Atom x; INTERLOCKED { static VectorMap atoms; @@ -33,14 +33,14 @@ Atom XAtom(const char *name) String XAtomName(Atom atom) { - GuiLock __; + GuiLock __; LLOG("GetAtomName"); return XGetAtomName(Xdisplay, atom); } String GetProperty(Window w, Atom property, Atom rtype) { - GuiLock __; + GuiLock __; LLOG("GetProperty"); String result; int format; @@ -52,9 +52,9 @@ String GetProperty(Window w, Atom property, Atom rtype) while(after > 0) { if(XGetWindowProperty(Xdisplay, w, property, offset, rsize, XFalse, rtype, &type, &format, &nitems, &after, &data) != Success) - break; + break; if(type == None) - break; + break; if(data) { int len = format == 32 ? sizeof(unsigned long) * nitems : nitems * (format >> 3); result.Cat(data, len); @@ -70,7 +70,7 @@ String GetProperty(Window w, Atom property, Atom rtype) } bool WaitForEvent(Window w, int type, XEvent& event){ - GuiLock __; + GuiLock __; for(int i = 0; i < 80; i++) { if(XCheckTypedWindowEvent(Xdisplay, w, type, &event)) return true; @@ -84,7 +84,7 @@ bool WaitForEvent(Window w, int type, XEvent& event){ String ReadPropertyData(Window w, Atom property, Atom rtype) { - GuiLock __; + GuiLock __; static Atom XA_INCR = XAtom("INCR"); Atom type; int format; @@ -120,7 +120,7 @@ String ReadPropertyData(Window w, Atom property, Atom rtype) Vector GetPropertyInts(Window w, Atom property, Atom rtype) { - GuiLock __; + GuiLock __; Vector result; String p = GetProperty(w, property, rtype); const long int *ptr = (const long int *)~p; @@ -141,7 +141,7 @@ bool X11ErrorTrap; bool Ctrl::TrapX11Errors() { - GuiLock __; + GuiLock __; bool b = X11ErrorTrap; X11ErrorTrap = true; return b; @@ -149,7 +149,7 @@ bool Ctrl::TrapX11Errors() void Ctrl::UntrapX11Errors(bool b) { - GuiLock __; + GuiLock __; X11ErrorTrap = b; } @@ -445,7 +445,7 @@ void Ctrl::InitX11(const char *display) void Ctrl::ExitX11() { - GuiLock __; + GuiLock __; // if(xic) // XDestroyIC(xic); TopWindow::ShutdownWindows(); diff --git a/uppsrc/CtrlCore/X11Proc.cpp b/uppsrc/CtrlCore/X11Proc.cpp index 37fefb63a..a435d8d45 100644 --- a/uppsrc/CtrlCore/X11Proc.cpp +++ b/uppsrc/CtrlCore/X11Proc.cpp @@ -262,7 +262,7 @@ void Ctrl::EventProc(XWindow& w, XEvent *event) } #ifndef PLATFORM_OSX11 if(GetCtrl() || GetAlt()) { // fix Ctrl+Shift+1 etc... - keysym = decode(event->xkey.keycode, 0xa, '1', 0xb, '2', 0xc, '3', 0xd, '4', + keysym = decode((int)event->xkey.keycode, 0xa, '1', 0xb, '2', 0xc, '3', 0xd, '4', 0xe, '5', 0xf, '6', 0x10, '7', 0x11, '8', 0x12, '9', 0x13, '0', keysym); } diff --git a/uppsrc/CtrlCore/gtk3-todo.txt b/uppsrc/CtrlCore/gtk3-todo.txt index ac4145c41..b4f378a81 100644 --- a/uppsrc/CtrlCore/gtk3-todo.txt +++ b/uppsrc/CtrlCore/gtk3-todo.txt @@ -6,14 +6,15 @@ - Pushbutton push does not look nice - Disabled empty combobox (FileSel::SelectDir) does not look nice - Problem with radio buttons in StdStyle - perhaps too big? +- ide menu in X11 ch +- disabled combobox issue +- OpenGL NTH: - spinbutton cosmetics - Redmond scrollbars width -- Improve scrollbars borders - -PROBABLY DONE: -- Problem with hot3 in scrollbar horizontal (check in SD) +- Improve scrollbars button borders +- Error state (red) EditField cosmetics DONE: @@ -66,3 +67,4 @@ DONE: - FileSel icons for Video etc - ColumnList selected item background (Mint-X) - disabled color in Breeze-Dark +- Problem with hot3 in scrollbar horizontal (check in SD) diff --git a/uppsrc/CtrlLib/ChGtk3.cpp b/uppsrc/CtrlLib/ChGtk3.cpp index 339c616a5..64e712261 100644 --- a/uppsrc/CtrlLib/ChGtk3.cpp +++ b/uppsrc/CtrlLib/ChGtk3.cpp @@ -210,10 +210,10 @@ void SOImages(int imli, dword flags) { for(int st = 0; st < 4; st++) { Gtk_State(st, flags); - CtrlsImg::Set(imli++, CairoImage(16, 16, [&](cairo_t *cr) { - gtk_render_background(sCtx, cr, 0, 0, 16, 16); - gtk_render_frame(sCtx, cr, 0, 0, 16, 16); - gtk_render_check(sCtx, cr, 0, 0, 16, 16); + CtrlsImg::Set(imli++, CairoImage(14, 14, [&](cairo_t *cr) { + gtk_render_background(sCtx, cr, 0, 0, 14, 14); + gtk_render_frame(sCtx, cr, 0, 0, 14, 14); + gtk_render_check(sCtx, cr, 0, 0, 14, 14); })); } } diff --git a/uppsrc/GLCtrl/GLCtrl.h b/uppsrc/GLCtrl/GLCtrl.h index 7677d10d7..b286d49e1 100644 --- a/uppsrc/GLCtrl/GLCtrl.h +++ b/uppsrc/GLCtrl/GLCtrl.h @@ -59,6 +59,7 @@ private: virtual Image MouseEvent(int event, Point p, int zdelta, dword keyflags); public: + void ExecuteGL(Event<> paint, bool swap_buffers); GLPane() { NoWantFocus(); } }; #elif defined(PLATFORM_WIN32) diff --git a/uppsrc/GLCtrl/GLCtrl.upp b/uppsrc/GLCtrl/GLCtrl.upp index fd8b40a67..318963927 100644 --- a/uppsrc/GLCtrl/GLCtrl.upp +++ b/uppsrc/GLCtrl/GLCtrl.upp @@ -6,8 +6,6 @@ library(WIN32 GCC) "glaux glu32 opengl32"; library(LINUX | BSD) "GL GLU"; -library((LINUX | BSD) & !X11 & !NOGTK) "gdkglext-x11-1.0 gtkglext-x11-1.0"; - file GLCtrl.h, Win32GLCtrl.cpp, diff --git a/uppsrc/GLCtrl/X11GLCtrl.cpp b/uppsrc/GLCtrl/X11GLCtrl.cpp index a60d614a7..1ee811802 100644 --- a/uppsrc/GLCtrl/X11GLCtrl.cpp +++ b/uppsrc/GLCtrl/X11GLCtrl.cpp @@ -44,6 +44,36 @@ void GLCtrl::GLPane::SetAttributes(unsigned long &ValueMask, XSetWindowAttribute winAttributes.save_under = XFalse; } +void GLCtrl::GLPane::ExecuteGL(Event<> paint, bool swap_buffers) +{ + MemoryIgnoreLeaksBlock __; + + glXMakeCurrent((XDisplay*)Xdisplay, GetWindow(), s_GLXContext); + + ONCELOCK { + glewInit(); + } + + paint(); + + if(swap_buffers) + glXSwapBuffers((XDisplay*)Xdisplay, GetWindow()); + else + glFlush(); + + glXMakeCurrent((XDisplay*)Xdisplay, GetWindow(), NULL); +} + +#if 0 +void GLCtrl::GLPane::Paint(Draw& w) +{ + Size sz = GetSize(); + if(!s_GLXContext || sz.cx == 0 || sz.cy == 0) + return; + + ExecuteGL([&] { ctrl->DoGLPaint(); }, doubleBuffering); +} +#else void GLCtrl::GLPane::Paint(Draw &draw) { if(!s_GLXContext) @@ -64,6 +94,11 @@ void GLCtrl::GLPane::Paint(Draw &draw) glXMakeCurrent( (XDisplay*)Xdisplay, GetWindow(), NULL); } +#endif +void GLCtrl::ExecuteGL(Event<> paint, bool swap_buffers) +{ + pane.ExecuteGL(paint, swap_buffers); +} #endif