Skip to content

Commit db18943

Browse files
committed
removed resizing mode ...
1 parent b20b699 commit db18943

12 files changed

Lines changed: 187 additions & 134 deletions

File tree

LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ Atom LFSTK_windowClass::LFSTK_getDnDAtom(int atomnum)
11401140
//This fetches all the data from a property
11411141
propertyStruct* LFSTK_windowClass::readProperty(Window src,Atom property)
11421142
{
1143-
Atom actual_type;
1143+
Atom actual_type;
11441144
int actual_format;
11451145
unsigned long nitems;
11461146
unsigned long bytes_after;

LFSWM2/ChangeLog

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
1.0.3
2+
Removed resizing mode.
3+
Removed xrender dep.
4+
Removed xcomposite dep.
5+
Fixed some mem leaks.
6+
Removed xinerama dep.
7+
18
1.0.2
2-
fixed window controls when no close button showing.
9+
Fixed window controls when no close button showing.
310
Fixed window losing focus when switching to fullscreen from window menu.
411
Fixed new windows occasionally not getting focus.
512
Removed alarm timer, now use 'kill -SIGUSR1 $(pgrep "^lfswm2$")' to signal a change.

LFSWM2/LFSWM2/flagsandlibs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ AUTOMAKE_OPTIONS = subdir-objects
33
AM_CPPFLAGS =-I$(top_srcdir) \
44
-I.. \
55
$(X11_CFLAGS) \
6-
$(XINERAMA_CFLAGS) \
76
$(XFT_CFLAGS) \
87
$(XRENDER_CFLAGS) \
98
$(XEXT_CFLAGS) \
@@ -18,7 +17,6 @@ AM_CPPFLAGS =-I$(top_srcdir) \
1817

1918
LIBS = $(X11_LIBS) \
2019
$(XRENDER_LIBS) \
21-
$(XINERAMA_LIBS) \
2220
$(XFT_LIBS) \
2321
$(XEXT_LIBS) \
2422
$(IMLIB_LIBS) \

LFSWM2/LFSWM2/src/clientClass.cpp

Lines changed: 80 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ LFSWM2_clientClass::LFSWM2_clientClass(LFSWM2_Class *mainclass,Window id)
2525
int menucnt=0;
2626

2727
this->mainClass=mainclass;
28-
this->picFormat=XRenderFindStandardFormat(this->mainClass->display,PictStandardRGB24);
29-
this->pa.subwindow_mode=IncludeInferiors;
28+
//this->picFormat=XRenderFindStandardFormat(this->mainClass->display,PictStandardRGB24);
29+
//this->pa.subwindow_mode=IncludeInferiors;
3030
while(menuItemlabels[menucnt]!=NULL)
3131
menuNames.push_back(menuItemlabels[menucnt++]);
3232
}
@@ -35,7 +35,9 @@ LFSWM2_clientClass::~LFSWM2_clientClass(void)
3535
{
3636
XWindowAttributes x_window_attrs;
3737

38-
this->mainClass->mainWindowClass->LFSWM2_freeHints(this->windowHints);
38+
// if(this->windowHints!=NULL)
39+
// this->mainClass->mainWindowClass->LFSWM2_freeHints(this->windowHints);
40+
this->mainClass->LFSWM2_freeHints(&this->windowHints);
3941
this->mainClass->mainWindowClass->LFSWM2_setClientList(this->contentWindow,false);
4042

4143
this->mainClass->mainWindowClass->LFSWM2_deleteClientEntry(this->frameWindow);
@@ -96,7 +98,7 @@ void LFSWM2_clientClass::LFSWM2_setWindowName(void)
9698
if(namex!=NULL)
9799
{
98100
this->name=namex;
99-
this->nameIsUTF=false;;
101+
this->nameIsUTF=false;
100102
}
101103
XFree(p.value);
102104
}
@@ -255,39 +257,39 @@ bool LFSWM2_clientClass::doResizeDraggers(XEvent *e)
255257
this->setWindowRects(false);
256258
this->dragRect=this->frameWindowRect;
257259

258-
switch(this->resizeMode)
259-
{
260-
case FASTRESIZE:
261-
XMoveWindow(this->mainClass->display,this->contentWindow,this->frameWindowRect.w+10,0);
262-
break;
263-
case LIVERESIZE:
264-
break;
265-
case SIZERESIZE:
266-
break;
267-
case SCALERESIZE:
268-
{
269-
this->currentRootPixmap=XCreatePixmap(this->mainClass->display,this->contentWindow,this->contentWindowRect.w,this->contentWindowRect.h,this->mainClass->depth);
270-
XSetClipMask(this->mainClass->display,this->mainClass->mainGC,None);
271-
XSetClipOrigin(this->mainClass->display, this->mainClass->mainGC,0,0);
272-
this->resizeImage=XGetImage(this->mainClass->display,this->contentWindow,0,0,this->contentWindowRect.w,this->contentWindowRect.h,AllPlanes,ZPixmap);
273-
274-
XSetClipMask(this->mainClass->display,this->mainClass->mainGC,None);
275-
XSetClipOrigin(this->mainClass->display,this->mainClass->mainGC,0,0);
276-
XPutImage(this->mainClass->display,this->currentRootPixmap, this->mainClass->mainGC,this->resizeImage,0,0,0,0,this->contentWindowRect.w,this->contentWindowRect.h);
277-
278-
this->ow=this->contentWindowRect.w;
279-
this->oh=this->contentWindowRect.h;
280-
this->resizeWindow=XCreateSimpleWindow(this->mainClass->display,this->frameWindow,this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,this->contentWindowRect.w,this->contentWindowRect.h,BORDER_WIDTH,this->mainClass->frameFG->pixel,this->mainClass->frameBG->pixel);
281-
XMoveWindow(this->mainClass->display,this->contentWindow,this->mainClass->displayWidth+10,0);
282-
XMapWindow(this->mainClass->display,this->resizeWindow);
283-
XRaiseWindow(this->mainClass->display,this->resizeWindow);
284-
primaryPicture=XRenderCreatePicture(this->mainClass->display,this->currentRootPixmap,picFormat,CPSubwindowMode,&pa);
285-
windowPicture=XRenderCreatePicture(this->mainClass->display,this->resizeWindow,picFormat,CPSubwindowMode,&pa);
286-
287-
XRenderComposite(this->mainClass->display,PictOpSrc,primaryPicture,0,windowPicture,0,0,0,0,0,0,this->ow,this->oh);
288-
}
289-
break;
290-
}
260+
// switch(this->resizeMode)
261+
// {
262+
// case FASTRESIZE:
263+
// XMoveWindow(this->mainClass->display,this->contentWindow,this->frameWindowRect.w+10,0);
264+
// break;
265+
// case LIVERESIZE:
266+
// break;
267+
// case SIZERESIZE:
268+
// break;
269+
//// case SCALERESIZE:
270+
//// {
271+
//// this->currentRootPixmap=XCreatePixmap(this->mainClass->display,this->contentWindow,this->contentWindowRect.w,this->contentWindowRect.h,this->mainClass->depth);
272+
//// XSetClipMask(this->mainClass->display,this->mainClass->mainGC,None);
273+
//// XSetClipOrigin(this->mainClass->display, this->mainClass->mainGC,0,0);
274+
//// this->resizeImage=XGetImage(this->mainClass->display,this->contentWindow,0,0,this->contentWindowRect.w,this->contentWindowRect.h,AllPlanes,ZPixmap);
275+
////
276+
//// XSetClipMask(this->mainClass->display,this->mainClass->mainGC,None);
277+
//// XSetClipOrigin(this->mainClass->display,this->mainClass->mainGC,0,0);
278+
//// XPutImage(this->mainClass->display,this->currentRootPixmap, this->mainClass->mainGC,this->resizeImage,0,0,0,0,this->contentWindowRect.w,this->contentWindowRect.h);
279+
////
280+
//// this->ow=this->contentWindowRect.w;
281+
//// this->oh=this->contentWindowRect.h;
282+
//// this->resizeWindow=XCreateSimpleWindow(this->mainClass->display,this->frameWindow,this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,this->contentWindowRect.w,this->contentWindowRect.h,BORDER_WIDTH,this->mainClass->frameFG->pixel,this->mainClass->frameBG->pixel);
283+
//// XMoveWindow(this->mainClass->display,this->contentWindow,this->mainClass->displayWidth+10,0);
284+
//// XMapWindow(this->mainClass->display,this->resizeWindow);
285+
//// XRaiseWindow(this->mainClass->display,this->resizeWindow);
286+
//// primaryPicture=XRenderCreatePicture(this->mainClass->display,this->currentRootPixmap,picFormat,CPSubwindowMode,&pa);
287+
//// windowPicture=XRenderCreatePicture(this->mainClass->display,this->resizeWindow,picFormat,CPSubwindowMode,&pa);
288+
////
289+
//// XRenderComposite(this->mainClass->display,PictOpSrc,primaryPicture,0,windowPicture,0,0,0,0,0,0,this->ow,this->oh);
290+
//// }
291+
//// break;
292+
// }
291293
}
292294
break;
293295

@@ -299,19 +301,19 @@ bool LFSWM2_clientClass::doResizeDraggers(XEvent *e)
299301
this->isShaded=false;
300302
this->adjustContentWindow();
301303
this->resetContentWindow();
302-
if(this->currentRootPixmap!=None)
303-
XFreePixmap(this->mainClass->display,this->currentRootPixmap);
304-
if(this->primaryPicture!=None)
305-
XRenderFreePicture(this->mainClass->display,this->primaryPicture);
306-
if(this->windowPicture!=None)
307-
XRenderFreePicture(this->mainClass->display,this->windowPicture);
308-
if(this->resizeImage!=NULL)
309-
XDestroyImage(this->resizeImage);
310-
311-
this->currentRootPixmap=None;
312-
this->primaryPicture=None;
313-
this->windowPicture=None;
314-
this->resizeImage=None;
304+
//if(this->currentRootPixmap!=None)
305+
// XFreePixmap(this->mainClass->display,this->currentRootPixmap);
306+
//if(this->primaryPicture!=None)
307+
// XRenderFreePicture(this->mainClass->display,this->primaryPicture);
308+
//if(this->windowPicture!=None)
309+
// XRenderFreePicture(this->mainClass->display,this->windowPicture);
310+
//if(this->resizeImage!=NULL)
311+
// XDestroyImage(this->resizeImage);
312+
313+
//this->currentRootPixmap=None;
314+
//this->primaryPicture=None;
315+
//this->windowPicture=None;
316+
//this->resizeImage=None;
315317

316318
XMoveResizeWindow(this->mainClass->display,this->resizeWindow,this->mainClass->displayWidth+10,0,1,1);
317319
this->setWindowRects(true);
@@ -385,34 +387,34 @@ bool LFSWM2_clientClass::doResizeDraggers(XEvent *e)
385387
this->frameWindowRect=r;
386388
XMoveResizeWindow(this->mainClass->display,this->frameWindow,r.x,r.y,r.w,r.h);
387389

388-
if(this->resizeMode==SCALERESIZE)
389-
{
390-
XResizeWindow(this->mainClass->display,this->resizeWindow,r.w-contentwadjust,r.h-contenthadjust);
391-
double x_scale=(double)ow /((double)this->frameWindowRect.w-(double)(this->mainClass->leftSideBarSize+this->mainClass->riteSideBarSize));
392-
double y_scale=(double)oh /((double)this->frameWindowRect.h-(double)(this->mainClass->titleBarSize+this->mainClass->bottomBarSize));
393-
XTransform transform_matrix1=
394-
{{
395-
{XDoubleToFixed(x_scale),XDoubleToFixed(0),XDoubleToFixed(0)},
396-
{XDoubleToFixed(0),XDoubleToFixed(y_scale),XDoubleToFixed(0)},
397-
{XDoubleToFixed(0),XDoubleToFixed(0),XDoubleToFixed(1.0)}
398-
}};
399-
XResizeWindow(this->mainClass->display,this->contentWindow,r.w-contentwadjust,r.h-contenthadjust);
400-
XRenderSetPictureTransform(this->mainClass->display,primaryPicture,&transform_matrix1);
401-
XRenderComposite(this->mainClass->display,PictOpSrc,primaryPicture,0,windowPicture,0,0,0,0,0,0,r.w-contentwadjust,r.h-contenthadjust);
402-
403-
this->steps=0;
404-
break;
405-
}
406-
407-
if(this->resizeMode==LIVERESIZE)
390+
// if(this->resizeMode==SCALERESIZE)
391+
// {
392+
// XResizeWindow(this->mainClass->display,this->resizeWindow,r.w-contentwadjust,r.h-contenthadjust);
393+
// double x_scale=(double)ow /((double)this->frameWindowRect.w-(double)(this->mainClass->leftSideBarSize+this->mainClass->riteSideBarSize));
394+
// double y_scale=(double)oh /((double)this->frameWindowRect.h-(double)(this->mainClass->titleBarSize+this->mainClass->bottomBarSize));
395+
// XTransform transform_matrix1=
396+
// {{
397+
// {XDoubleToFixed(x_scale),XDoubleToFixed(0),XDoubleToFixed(0)},
398+
// {XDoubleToFixed(0),XDoubleToFixed(y_scale),XDoubleToFixed(0)},
399+
// {XDoubleToFixed(0),XDoubleToFixed(0),XDoubleToFixed(1.0)}
400+
// }};
401+
// XResizeWindow(this->mainClass->display,this->contentWindow,r.w-contentwadjust,r.h-contenthadjust);
402+
// XRenderSetPictureTransform(this->mainClass->display,primaryPicture,&transform_matrix1);
403+
// XRenderComposite(this->mainClass->display,PictOpSrc,primaryPicture,0,windowPicture,0,0,0,0,0,0,r.w-contentwadjust,r.h-contenthadjust);
404+
//
405+
// this->steps=0;
406+
// break;
407+
// }
408+
409+
//if(this->resizeMode==LIVERESIZE)
408410
{
409411
this->contentWindowRect={this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,r.w-contentwadjust,r.h-contenthadjust};
410412
XResizeWindow(this->mainClass->display,this->contentWindow,r.w-contentwadjust,r.h-contenthadjust);
411413
}
412-
else
413-
{
414-
XMoveWindow(this->mainClass->display,this->contentWindow,this->frameWindowRect.w+10,0);
415-
}
414+
// else
415+
// {
416+
// XMoveWindow(this->mainClass->display,this->contentWindow,this->frameWindowRect.w+10,0);
417+
// }
416418

417419
this->steps=0;
418420
break;
@@ -611,10 +613,10 @@ bool LFSWM2_clientClass::wmCB(void *p,void* ud)
611613

612614
if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("Close")==0)
613615
cc->LFSWM2_sendCloseWindow();
614-
if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("Fast Resize")==0)
615-
cc->resizeMode=FASTRESIZE;
616-
if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("Live Resize")==0)
617-
cc->resizeMode=LIVERESIZE;
616+
//if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("Fast Resize")==0)
617+
// cc->resizeMode=FASTRESIZE;
618+
//if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("Live Resize")==0)
619+
// cc->resizeMode=LIVERESIZE;
618620

619621
if(static_cast<LFSTK_gadgetClass*>(p)->LFSTK_getLabel().compare("About")==0)
620622
system("lfsabout &");

LFSWM2/LFSWM2/src/clientClass.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@
3131
#define SKIPTIME 10
3232
#define MAXCONFIGCNT 8
3333

34-
static const char *menuItemlabels[]={"Maximize","Minimize","Shade","Fullscreen","--","On Top","On Bottom","On All Desks","--","Fast Resize","Live Resize","--","Close","--","About",NULL};
35-
static const char *altMenuitemlabels[]={"Un-Maximize","Un-Minimize","Un-Shade","Un-Fullscreen","--","Not On Top","Not On Bottom","Only This Desk","--","Fast Resize","Live Resize","--","Close","--","About",NULL};
34+
//static const char *menuItemlabels[]={"Maximize","Minimize","Shade","Fullscreen","--","On Top","On Bottom","On All Desks","--","Fast Resize","Live Resize","--","Close","--","About",NULL};
35+
//static const char *altMenuitemlabels[]={"Un-Maximize","Un-Minimize","Un-Shade","Un-Fullscreen","--","Not On Top","Not On Bottom","Only This Desk","--","Fast Resize","Live Resize","--","Close","--","About",NULL};
3636

37-
enum {MAXLABEL=0,MINLABEL,SHADELABEL,FSLABEL,PASS1,ONTOPLABEL,ONBOTTOMLABEL,ONALLDESKSLABEL,PASS2,FASTSIZELABEL,LIVESIZELABEL,PASS3,CLOSELABEL,PASS4,ABOUTLABEL,NUMOFMENUS};
37+
static const char *menuItemlabels[]={"Maximize","Minimize","Shade","Fullscreen","--","On Top","On Bottom","On All Desks","--","Close","--","About",NULL};
38+
static const char *altMenuitemlabels[]={"Un-Maximize","Un-Minimize","Un-Shade","Un-Fullscreen","--","Not On Top","Not On Bottom","Only This Desk","--","Close","--","About",NULL};
39+
40+
//enum {MAXLABEL=0,MINLABEL,SHADELABEL,FSLABEL,PASS1,ONTOPLABEL,ONBOTTOMLABEL,ONALLDESKSLABEL,PASS2,FASTSIZELABEL,LIVESIZELABEL,PASS3,CLOSELABEL,PASS4,ABOUTLABEL,NUMOFMENUS};
41+
enum {MAXLABEL=0,MINLABEL,SHADELABEL,FSLABEL,PASS1,ONTOPLABEL,ONBOTTOMLABEL,ONALLDESKSLABEL,PASS2,CLOSELABEL,PASS4,ABOUTLABEL,NUMOFMENUS};
3842

3943
class LFSWM2_clientClass
4044
{
@@ -78,7 +82,7 @@ class LFSWM2_clientClass
7882
bool isHidden=false;
7983
bool isMinimized=false;
8084

81-
int resizeMode=0;
85+
//int resizeMode=0;
8286
int configCnt=0;
8387

8488
rectStruct contentWindowRect;
@@ -171,14 +175,14 @@ class LFSWM2_clientClass
171175
rectStruct dragRect;
172176
rectStruct holdFrameRect={-1,-1,-1,-1};
173177

174-
Pixmap currentRootPixmap=None;
175-
Picture windowPicture=None;
176-
Picture primaryPicture=None;
177-
XRenderPictureAttributes pa;
178-
XRenderPictFormat *picFormat;
178+
//Pixmap currentRootPixmap=None;
179+
//Picture windowPicture=None;
180+
//Picture primaryPicture=None;
181+
//XRenderPictureAttributes pa;
182+
//XRenderPictFormat *picFormat;
179183
int ow;
180184
int oh;
181-
XImage *resizeImage=NULL;
185+
//XImage *resizeImage=NULL;
182186

183187
bool first=true;
184188
int firstx=-10000;

LFSWM2/LFSWM2/src/eventsClass.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int LFSWM2_eventsClass::checkMessages(void)
7272
this->mainClass->mainWindowClass->LFSWM2_setControlRects(ccs);
7373
ccs->resetContentWindow();
7474
this->mainClass->mainWindowClass->LFSWM2_refreshFrame(ccs);
75-
ccs->resizeMode=this->mainClass->resizeMode;
75+
//ccs->resizeMode=this->mainClass->resizeMode;
7676
}
7777
}
7878

@@ -106,7 +106,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
106106
XButtonEvent start;
107107
int when=0;
108108
LFSWM2_clientClass *cc;
109-
LFSWM2_clientClass *cccontrol;
109+
LFSWM2_clientClass *cccontrol=NULL;
110110
bool overide=false;
111111
bool inmenu=false;
112112
int lastbutton=-1;
@@ -289,6 +289,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
289289
//this->mainClass->DEBUG_printCurrentHintsDataStruct(hs);
290290
if((hs.mHints!=NULL) && (hs.mHints->decorations==0))
291291
{
292+
this->mainClass->LFSWM2_freeHints(&hs);
292293
if(this->mainClass->mainWindowClass->LFSWM2_createUnframedWindow(e.xmaprequest.window)==true)
293294
{
294295
this->noRestack=false;
@@ -298,7 +299,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
298299
XMoveWindow(this->mainClass->display,e.xmaprequest.window,-1000000,-1000000);
299300
if(this->mainClass->mainWindowClass->LFSWM2_createClient(e.xmaprequest.window,hs)==false)
300301
{
301-
this->mainClass->mainWindowClass->LFSWM2_freeHints(hs);
302+
this->mainClass->LFSWM2_freeHints(&hs);
302303
//fprintf(stderr,"LFSWM2_createClient=false\n");
303304
}
304305
XMoveResizeWindow(this->mainClass->display,e.xmaprequest.window,this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,x_window_attrs.width,x_window_attrs.height);
@@ -336,7 +337,11 @@ this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,thi
336337
hintsDataStruct hs;
337338
hs=this->mainClass->mainWindowClass->LFSWM2_getWindowHints(e.xconfigurerequest.window);
338339
if((hs.mHints!=NULL) && (hs.mHints->decorations!=0))
339-
XMoveResizeWindow(this->mainClass->display,e.xconfigurerequest.window,hs.pt.x,hs.pt.y,hs.sh->min_width,hs.sh->min_height);
340+
{
341+
XMoveResizeWindow(this->mainClass->display,e.xconfigurerequest.window,hs.pt.x,hs.pt.y,hs.sh->min_width,hs.sh->min_height);
342+
this->mainClass->LFSWM2_freeHints(&hs);
343+
}
344+
340345
break;
341346
}
342347
cc->configCnt=0;
@@ -367,8 +372,8 @@ this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,thi
367372

368373
cc->setWindowRects(true);
369374

370-
if((cc->buttonDown==false) && (cc->resizeMode==SCALERESIZE))
371-
XMoveWindow(this->mainClass->display,cc->resizeWindow,-100000,-100000);
375+
//if((cc->buttonDown==false) && (cc->resizeMode==SCALERESIZE))
376+
// XMoveWindow(this->mainClass->display,cc->resizeWindow,-100000,-100000);
372377
break;
373378
}
374379
else
@@ -425,7 +430,7 @@ this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,thi
425430
{
426431
if(((xh->flags & StateHint)==StateHint) && (xh->initial_state==NormalState))
427432
unminim=true;
428-
XFree((void*)xh);
433+
XFree((void*)xh);
429434
}
430435
}
431436
if(unminim==true)
@@ -794,6 +799,8 @@ HIDEXERRORS
794799
cc2->LFSWM2_hideWindow(false);
795800
}
796801
}
802+
if(v!=NULL)
803+
XFree(v);
797804
}
798805
cnt++;
799806
}

0 commit comments

Comments
 (0)