From 8bbf538b8f552ad6f219eef03e797d471bf46a37 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 15 Jan 2020 18:44:23 +0000 Subject: [PATCH] CtrlCore: gtk3 warnings in GtkWnd removed git-svn-id: svn://ultimatepp.org/upp/trunk@13892 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/GtkAfter.h | 3 +++ uppsrc/CtrlCore/GtkWnd.cpp | 16 ++++++++++++++++ uppsrc/CtrlCore/gtk3-todo.txt | 6 ++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/uppsrc/CtrlCore/GtkAfter.h b/uppsrc/CtrlCore/GtkAfter.h index 05c65148f..f2bb78a15 100644 --- a/uppsrc/CtrlCore/GtkAfter.h +++ b/uppsrc/CtrlCore/GtkAfter.h @@ -1,4 +1,7 @@ class ViewDraw : public SystemDraw { +#if GTK_CHECK_VERSION(3, 10, 0) + GdkDrawingContext *ctx; +#endif public: ViewDraw(Ctrl *ctrl); ~ViewDraw(); diff --git a/uppsrc/CtrlCore/GtkWnd.cpp b/uppsrc/CtrlCore/GtkWnd.cpp index c1d82d3c4..d07251a8c 100644 --- a/uppsrc/CtrlCore/GtkWnd.cpp +++ b/uppsrc/CtrlCore/GtkWnd.cpp @@ -520,13 +520,29 @@ ViewDraw::ViewDraw(Ctrl *ctrl) { EnterGuiMutex(); Ctrl *top = ctrl->GetTopCtrl(); +#if GTK_CHECK_VERSION(3, 22, 0) + cairo_rectangle_int_t r; + r.x = r.y = 0; + r.width = r.height = 100000; + cairo_region_t *rg = cairo_region_create_rectangle(&r); + ctx = gdk_window_begin_draw_frame(top->gdk(), rg); + cairo_region_destroy(rg); + cr = gdk_drawing_context_get_cairo_context(ctx); +#else cr = gdk_cairo_create(top->gdk()); +#endif + cairo_scale(cr, Ctrl::LSC(1), Ctrl::LSC(1)); Clipoff(ctrl->GetScreenView() - top->GetScreenRect().TopLeft()); } ViewDraw::~ViewDraw() { + FlushText(); +#if GTK_CHECK_VERSION(3, 22, 0) + gdk_window_end_draw_frame(gdk_drawing_context_get_window(ctx), ctx); +#else cairo_destroy(cr); +#endif LeaveGuiMutex(); } diff --git a/uppsrc/CtrlCore/gtk3-todo.txt b/uppsrc/CtrlCore/gtk3-todo.txt index aa3cd5ee0..ce6088904 100644 --- a/uppsrc/CtrlCore/gtk3-todo.txt +++ b/uppsrc/CtrlCore/gtk3-todo.txt @@ -1,12 +1,12 @@ - Issue with editfield text clipping in the right -- Remove warnings - DropChoice STDSIZE (.TopPosZ(10)) - LeftRoundness with DropChoice (DropChoiceRdO) - DarkCold: problem slight problem with scrollbars - Pushbutton push does not look nice - Disabled empty combobox (FileSel::SelectDir) does not look nice - ide menu in X11 ch -- OpenGL +- GtkDnD warnings +- TrayIconGtk warnings NTH: - spinbutton cosmetics @@ -67,3 +67,5 @@ DONE: - disabled color in Breeze-Dark - Problem with hot3 in scrollbar horizontal (check in SD) - Problem with radio buttons in StdStyle - perhaps too big? +- OpenGL +- GtkWnd warnings