Skip to content

Commit 11c58b3

Browse files
committed
fixed window tile,fixed dock startup
1 parent 6661878 commit 11c58b3

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

LFSDock/ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
0.2.1
2+
Fixed setting window background.
23
Fixed unminimizing windows.
34
Fixed slider.
45
Fixed dock spuriously reappearing after iconizing.

LFSDock/LFSDock/src/main.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ int main(int argc,char **argv)
422422
win->decorated=false;
423423
apc->LFSTK_addWindow(win,"DOCKBG");
424424
//LFSTK_handleWindowEvents
425-
dockBGWindow=apc->windows->back().window;
426-
dockBGWindow->LFSTK_setTile(dockBGImage.c_str(),-1);
425+
dockBGWindow=apc->windows->back().window;
426+
std::string hi=dockBGImage;
427427
dockWindow->LFSTK_setTransientFor(dockBGWindow->window);
428428
apc->windows->back().showing=true;
429429

@@ -503,10 +503,14 @@ int main(int argc,char **argv)
503503
holdpsize=psize;
504504

505505

506-
507-
508-
509-
506+
XSync(apc->display,false);
507+
if(dockBGWindow!=NULL)
508+
{
509+
dockBGWindow->LFSTK_setTile(hi.c_str(),-1);
510+
dockBGWindow->LFSTK_clearWindow(true);
511+
}
512+
if(useTaskBar==true)
513+
updateTaskBar(true);
510514

511515
int retval=apc->LFSTK_runApp();
512516

LFSDock/LFSDock/src/taskBar.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ void updateTaskBar(bool force)//TODO//
252252
tasks.clear();
253253
doTreeWalkForTasks(apc->rootWindow);
254254
std::sort(tasks.begin(),tasks.end(),compareTaskClass);
255+
256+
if(force==false)
257+
{
255258
if(tasks.size()==holdtasks.size())
256259
{
257260
for(int j=0;j<holdtasks.size();j++)
@@ -265,15 +268,20 @@ void updateTaskBar(bool force)//TODO//
265268
}
266269
else
267270
unequal=true;
268-
271+
}
272+
else
273+
{
274+
unequal=true;
275+
oldwidth=1;
276+
}
269277
skiplabel:
270278
if((unequal==false) && (force==false))
271279
return;
272-
273280
if(tasks.size()==0)
274281
{
275282
if(oldwidth==0)
276283
return;
284+
fprintf(stderr,"here\n");
277285
oldwidth=0;
278286
moveDock(0);
279287
resizeDock(windowWidth,iconWidth+extraSpace);

LFSToolKit/ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
0.6.1
2+
Fix window tile cario surface getting occasional wrong size.
23
Added extra positioning for window context window.
34
Updated Window example.
45
Added context window to LFSTK_windowClass.

LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,17 @@ void LFSTK_windowClass::LFSTK_setTile(const char *path,int size)
989989
return;
990990
}
991991

992+
993+
if(this->cr!=NULL)
994+
cairo_destroy(this->cr);
995+
if(this->sfc!=NULL)
996+
cairo_surface_destroy(this->sfc);
997+
998+
this->sfc=NULL;
999+
this->cr=NULL;
1000+
1001+
this->globalLib->LFSTK_setCairoSurface(this->app->display,this->window,this->visual,&this->sfc,&this->cr,this->w,this->h);
1002+
9921003
if(this->sfc==NULL)
9931004
this->sfc=cairo_xlib_surface_create(this->app->display,this->window,this->visual,this->w,this->h);
9941005

@@ -1013,8 +1024,9 @@ void LFSTK_windowClass::LFSTK_setTile(const char *path,int size)
10131024
cairo_xlib_surface_set_size(this->sfc,this->w,this->h);
10141025
//cairo_xlib_surface_set_size(this->sfc,1000,1000);
10151026
this->pattern=cairo_pattern_create_for_surface(tempimage);
1016-
cairo_surface_destroy(tempimage);
10171027
cairo_pattern_set_extend(pattern,CAIRO_EXTEND_REPEAT);
1028+
cairo_surface_destroy(tempimage);
1029+
// fprintf(stderr,"cairo_xlib_surface_get_width=%i cairo_xlib_surface_get_height=%i\n",cairo_xlib_surface_get_width(sfc)+1,cairo_xlib_surface_get_height(sfc)+1);
10181030
this->useTile=true;
10191031
}
10201032
else

0 commit comments

Comments
 (0)