@@ -370,6 +370,18 @@ void LFSTK_windowClass::LFSTK_clearWindow(bool cleargadgets)
370370 }
371371}
372372
373+ /* *
374+ * Resize cairo surface and context to window size.
375+ * \param int width.
376+ * \param int height.
377+ */
378+ void LFSTK_windowClass::resizeCairoParts (int width,int height)
379+ {
380+ cairo_xlib_surface_set_size (this ->sfc ,width,height);
381+ cairo_destroy (this ->cr );
382+ this ->cr =cairo_create (this ->sfc );
383+ }
384+
373385/* *
374386* Resize window.
375387* \param w New width.
@@ -382,8 +394,8 @@ void LFSTK_windowClass::LFSTK_resizeWindow(int w,int h,bool tellx)
382394 this ->setWindowGeom (0 ,0 ,w,h,WINDSETWH );
383395 if (tellx==true )
384396 XResizeWindow (this ->app ->display ,this ->window ,w,h);
385-
386- this ->globalLib -> LFSTK_setCairoSurface ( this -> app -> display , this -> window , this -> visual ,& this -> sfc ,& this -> cr , w,h);
397+
398+ this ->resizeCairoParts ( w,h);
387399 this ->w =w;
388400 this ->h =h;
389401 this ->LFSTK_clearWindow (true );
@@ -418,7 +430,7 @@ void LFSTK_windowClass::LFSTK_moveResizeWindow(int x,int y,int w,int h,bool tell
418430 if (tellx==true )
419431 XMoveResizeWindow (this ->app ->display ,this ->window ,x,y,w,h);
420432
421- this ->globalLib -> LFSTK_setCairoSurface ( this -> app -> display , this -> window , this -> visual ,& this -> sfc ,& this -> cr , w,h);
433+ this ->resizeCairoParts ( w,h);
422434 this ->w =w;
423435 this ->h =h;
424436 this ->LFSTK_clearWindow ();
@@ -1008,7 +1020,6 @@ void LFSTK_windowClass::LFSTK_setTile(const char *path,int size)
10081020 return ;
10091021 }
10101022
1011-
10121023 if (this ->cr !=NULL )
10131024 cairo_destroy (this ->cr );
10141025 if (this ->sfc !=NULL )
0 commit comments