Skip to content

Commit 6661878

Browse files
committed
fixed minimizing windows,slider and task bar, see changelogs..
1 parent 8db2b45 commit 6661878

File tree

8 files changed

+101
-13
lines changed

8 files changed

+101
-13
lines changed

LFSDock/ChangeLog

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

LFSDock/LFSDock/src/taskBar.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ bool taskSelect(void *object,void* userdata)
114114
movetohere=false;
115115
}
116116
XMapWindow(apc->display,win);
117+
118+
XWMHints *xh=XAllocWMHints();
119+
xh->flags=StateHint;
120+
xh->initial_state=NormalState;
121+
XSetWMHints(dockWindow->app->display, win, xh);
122+
sendClientMessage(win,"WM_HINTS",0,0,0,0,0);
123+
XFree(xh);
117124
sendClientMessage(win,"_NET_ACTIVE_WINDOW",0,0,0,0,0);
125+
118126
inSomeWindow=false;
119127
showhidetActionList(NULL,popActionWindow,popActionList);
120128
return(true);

LFSPanel/LFSPanel/src/slider.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ void setLabel(void)
4040
{
4141
double maxvolume=double(atoi(mainwind->globalLib->LFSTK_oneLiner("amixer get Master|grep \"Limits\"|awk '{print $NF}'").c_str()));
4242
int value=(int)(((double)vsb->LFSTK_getValue()/(double)maxvolume)*100.0);
43+
44+
//fprintf(stderr,"val perc=%i %f\n",value,maxvolume);
45+
4346
sprintf(label,"Vol %i%%",value);
4447
volumeButton->LFSTK_setLabel(label);
4548
setIcon();

LFSWM2/ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
1.0.1
2+
Fixed (un)minimizing windows.
23
Fixed left/right side window resize draggers AGAIN!.
34
Fixed hiding/showing utility windows.
45
Fixed left/right side window resize draggers.

LFSWM2/LFSWM2/src/clientClass.cpp

+22-4
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,13 @@ void LFSWM2_clientClass::LFSWM2_unSpecial(void)
471471
{
472472
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ")));
473473
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT")));
474-
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")));
475474
this->isMaximized=false;
476475
}
476+
477+
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")));
477478
this->isShaded=false;
479+
this->isMinimized=false;
480+
this->mainClass->mainWindowClass->LFSWM2_setWindowState(this->contentWindow,NormalState);
478481
this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(this->contentWindow);
479482
}
480483

@@ -496,6 +499,8 @@ void LFSWM2_clientClass::LFSWM2_maxWindow(void)
496499
void LFSWM2_clientClass::LFSWM2_minWindow(void)
497500
{
498501
this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")));
502+
this->isMinimized=true;
503+
this->mainClass->mainWindowClass->LFSWM2_setWindowState(this->contentWindow,IconicState);
499504
this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(this->contentWindow);
500505
this->LFSWM2_hideWindow();
501506
}
@@ -904,11 +909,14 @@ void LFSWM2_clientClass::LFSWM2_showWindow(bool checkstate)
904909

905910
this->contentWindowRect=this->mainClass->mainWindowClass->LFSWM2_getWindowRect(this->contentWindow,this->mainClass->rootWindow);
906911
this->visible=true;
907-
if(this->isWithdrawn==true)
912+
// if(this->isWithdrawn==true)
908913
this->mainClass->mainWindowClass->LFSWM2_setWindowState(this->contentWindow,NormalState);
909914
this->isWithdrawn=false;
910915
this->isHidden=false;
916+
this->isMinimized=false;
917+
//this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")));
911918
XMapWindow(this->mainClass->display,this->frameWindow);
919+
//fprintf(stderr,">>>>>>>>>>>>>>>\n");
912920
}
913921

914922
void LFSWM2_clientClass::LFSWM2_hideWindow(bool withdraw)
@@ -1120,6 +1128,15 @@ rectStruct LFSWM2_clientClass::setTitlePosition(void)
11201128
bool LFSWM2_clientClass::LFSWM2_handleEvents(XEvent *e)
11211129
{
11221130
//this->mainClass->DEBUG_printEventData(e,true);
1131+
//if(e->xany.window==0x3400006)
1132+
//{
1133+
// //cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xkey.window);
1134+
// if((this!=NULL) && (this->isMinimized==true))
1135+
// {
1136+
// fprintf(stderr,">>>>>>>e.xany.window==0x3400006 cc->isMinimized==true cc->isVisible=%i\n",this->visible);
1137+
// //cc->LFSWM2_showWindow(false);
1138+
// }
1139+
//}
11231140
switch(e->type)
11241141
{
11251142
case ButtonPress:
@@ -1173,13 +1190,14 @@ bool LFSWM2_clientClass::LFSWM2_handleEvents(XEvent *e)
11731190

11741191
case MapNotify:
11751192
{
1176-
// std::cerr<<"client MapNotify"<<std::endl;
1193+
//std::cerr<<"client MapNotify"<<std::endl;
11771194
}
11781195
break;
11791196

11801197
case MapRequest:
11811198
//std::cerr<<"client MapRequest"<<std::endl;
1182-
this->LFSWM2_showWindow(false);
1199+
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")));
1200+
this->LFSWM2_showWindow(true);
11831201
this->mainClass->mainEventClass->noRestack=false;
11841202
break;
11851203

LFSWM2/LFSWM2/src/clientClass.h

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class LFSWM2_clientClass
7676
bool isWithdrawn=false;
7777
bool isBorderless=false;
7878
bool isHidden=false;
79+
bool isMinimized=false;
7980

8081
int resizeMode=0;
8182
int configCnt=0;

LFSWM2/LFSWM2/src/eventsClass.cpp

+60-5
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
174174
}
175175
}
176176

177+
//if(e.xany.window==0x3400006)
178+
//{
179+
// cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xkey.window);
180+
// if((cc!=NULL) && (cc->isMinimized==true))
181+
// {
182+
// fprintf(stderr,"e.xany.window==0x3400006 cc->isMinimized==true cc->isVisible=%i\n",cc->visible);
183+
// //cc->LFSWM2_showWindow(false);
184+
// }
185+
//}
186+
177187
switch(e.type)
178188
{
179189
case KeyRelease:
@@ -238,6 +248,18 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
238248
case MapNotify:
239249
{
240250
//fprintf(stderr,"MapNotify main event loop window=%x when=%i\n",e.xmap.window,when++);
251+
//
252+
//
253+
//cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xproperty.window);
254+
// if((cc!=NULL) )
255+
// {
256+
// fprintf(stderr,">>>>>>>\n");
257+
// // cc->LFSWM2_unSpecial();
258+
// // cc->LFSWM2_showWindow(false);
259+
// }
260+
261+
262+
241263
this->noRestack=false;
242264
Atom *v=NULL;
243265
long unsigned int nitems_return;
@@ -255,7 +277,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
255277

256278
case MapRequest:
257279
{
258-
//fprintf(stderr,"MapRequest main event loop window=%x when=%i\n",e.xmap.window,when++);
280+
// fprintf(stderr,"MapRequest main event loop window=%x when=%i\n",e.xmap.window,when++);
259281
this->noRestack=false;
260282
this->mainClass->mainWindowClass->LFSWM2_removeProp(this->mainClass->rootWindow,LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW"));
261283
XWindowAttributes x_window_attrs;
@@ -275,8 +297,10 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
275297
}
276298
XMoveWindow(this->mainClass->display,e.xmaprequest.window,-1000000,-1000000);
277299
if(this->mainClass->mainWindowClass->LFSWM2_createClient(e.xmaprequest.window,hs)==false)
278-
this->mainClass->mainWindowClass->LFSWM2_freeHints(hs);
279-
300+
{
301+
this->mainClass->mainWindowClass->LFSWM2_freeHints(hs);
302+
//fprintf(stderr,"LFSWM2_createClient=false\n");
303+
}
280304
XMoveResizeWindow(this->mainClass->display,e.xmaprequest.window,this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,x_window_attrs.width,x_window_attrs.height);
281305
this->noRestack=false;
282306
}
@@ -306,7 +330,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
306330
hs=this->mainClass->mainWindowClass->LFSWM2_getWindowHints(e.xconfigurerequest.window);
307331
if((hs.mHints!=NULL) && (hs.mHints->decorations!=0))
308332
XMoveResizeWindow(this->mainClass->display,e.xconfigurerequest.window,hs.pt.x,hs.pt.y,hs.sh->min_width,hs.sh->min_height);
309-
break;
333+
break;
310334
}
311335
cc->configCnt=0;
312336
if((e.xconfigurerequest.value_mask & (CWWidth|CWHeight)) !=0)
@@ -315,7 +339,6 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
315339
ch.height=e.xconfigurerequest.height+this->mainClass->titleBarSize+this->mainClass->bottomBarSize;
316340
if((cc->buttonDown==false) || (cc->isBorderless==false))
317341
{
318-
// if(cc->isBorderless==false)
319342
if((cc->isBorderless==false) && (cc->windowType!=UTILITYWINDOW))
320343
XResizeWindow(this->mainClass->display,cc->frameWindow,e.xconfigurerequest.width+this->mainClass->riteSideBarSize+this->mainClass->leftSideBarSize,e.xconfigurerequest.height+this->mainClass->titleBarSize+this->mainClass->bottomBarSize);
321344
else
@@ -384,6 +407,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
384407
{
385408
//fprintf(stderr,"PropertyNotify IN eventnumber %i atom name=%s\n",when++,XGetAtomName(this->mainClass->display,e.xproperty.atom));
386409
LFSWM2_clientClass *cc;
410+
//if(e.xproperty.window==0x3200006)
387411
if(false)
388412
{
389413
fprintf(stderr,"PropertyNotify eventnumber %i\n",when++);
@@ -399,6 +423,35 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
399423
#endif
400424
}
401425

426+
if(e.xproperty.state==PropertyNewValue)
427+
{
428+
bool unminim=false;
429+
cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xproperty.window);
430+
if((cc!=NULL) && (cc->isMinimized==true))
431+
{
432+
if(!this->mainClass->mainWindowClass->LFSWM2_hasState(cc->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))))
433+
unminim=true;
434+
435+
if((cc->visible==false) && (e.xproperty.atom==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_HINTS"))))
436+
{
437+
XWMHints *xh=XGetWMHints(this->mainClass->display, e.xproperty.window);
438+
if(xh!=NULL)
439+
{
440+
if(((xh->flags & StateHint)==StateHint) && (xh->initial_state==NormalState))
441+
unminim=true;
442+
XFree((void*)xh);
443+
}
444+
}
445+
if(unminim==true)
446+
{
447+
cc->LFSWM2_unSpecial();
448+
cc->LFSWM2_showWindow(false);
449+
}
450+
this->noRestack=false;
451+
break;
452+
}
453+
}
454+
402455
if((e.xproperty.state==PropertyNewValue) || (e.xproperty.state==PropertyDelete))
403456
{
404457
if(e.xproperty.atom==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")))
@@ -437,6 +490,8 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void)
437490
cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xproperty.window);
438491
if(cc!=NULL)
439492
{
493+
//if(cc->isMinimized==true)
494+
// cc->LFSWM2_showWindow(false);
440495
this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(cc->contentWindow);
441496
}
442497
}

LFSWM2/LFSWM2/src/lfswm2Class.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "lfswm2Class.h"
2929

30-
const char *atomNames[]={"_NET_WM_WINDOW_TYPE_MENU","_NET_ACTIVE_WINDOW","_NET_CLIENT_LIST","_NET_CLIENT_LIST_STACKING","_NET_CLOSE_WINDOW","_NET_CURRENT_DESKTOP","_NET_DESKTOP_GEOMETRY","_NET_DESKTOP_VIEWPORT","_NET_FRAME_EXTENTS","_NET_NUMBER_OF_DESKTOPS","_NET_REQUEST_FRAME_EXTENTS","_NET_SUPPORTED","_NET_SUPPORTING_WM_CHECK","_NET_WM_ACTION_CHANGE_DESKTOP","_NET_WM_ACTION_CLOSE","_NET_WM_ACTION_FULLSCREEN","_NET_WM_ACTION_MINIMIZE","_NET_WM_ACTION_MAXIMIZE_HORZ","_NET_WM_ACTION_MAXIMIZE_VERT","_NET_WM_ACTION_RESIZE","_NET_WM_ALLOWED_ACTIONS","_NET_WM_DESKTOP","_NET_WM_ICON_NAME","_NET_WM_NAME","_NET_WM_STATE","_NET_WM_STATE_ABOVE","_NET_WM_STATE_BELOW","_NET_WM_STATE_FULLSCREEN","_NET_WM_STATE_HIDDEN","_NET_WM_STATE_SKIP_TASKBAR","_NET_WM_VISIBLE_ICON_NAME","_NET_WM_VISIBLE_NAME","_NET_WM_WINDOW_TYPE","_NET_WM_WINDOW_TYPE_DOCK","_NET_WORKAREA","_NET_WM_WINDOW_TYPE_DESKTOP","_NET_WM_WINDOW_TYPE_NORMAL","_NET_WM_STATE_STICKY","_NET_WM_STATE_MAXIMIZED_VERT","_NET_WM_STATE_MAXIMIZED_HORZ","UTF8_STRING","MOTIF_WM_HINTS","WM_CHANGE_STATE","WM_DELETE_WINDOW","WM_PROTOCOLS","WM_STATE","_NET_WM_WINDOW_TYPE_DIALOG","_NET_WM_WINDOW_TYPE_TOOL","_MOTIF_WM_HINTS","_WM_NORMAL_HINTS","_NET_WM_PID","_NET_WM_USER_TIME","WM_TRANSIENT_FOR","_XROOTPMAP_ID",NULL};
30+
const char *atomNames[]={"_NET_WM_WINDOW_TYPE_MENU","_NET_ACTIVE_WINDOW","_NET_CLIENT_LIST","_NET_CLIENT_LIST_STACKING","_NET_CLOSE_WINDOW","_NET_CURRENT_DESKTOP","_NET_DESKTOP_GEOMETRY","_NET_DESKTOP_VIEWPORT","_NET_FRAME_EXTENTS","_NET_NUMBER_OF_DESKTOPS","_NET_REQUEST_FRAME_EXTENTS","_NET_SUPPORTED","_NET_SUPPORTING_WM_CHECK","_NET_WM_ACTION_CHANGE_DESKTOP","_NET_WM_ACTION_CLOSE","_NET_WM_ACTION_FULLSCREEN","_NET_WM_ACTION_MINIMIZE","_NET_WM_ACTION_MAXIMIZE_HORZ","_NET_WM_ACTION_MAXIMIZE_VERT","_NET_WM_ACTION_RESIZE","_NET_WM_ALLOWED_ACTIONS","_NET_WM_DESKTOP","_NET_WM_ICON_NAME","_NET_WM_NAME","_NET_WM_STATE","_NET_WM_STATE_ABOVE","_NET_WM_STATE_BELOW","_NET_WM_STATE_FULLSCREEN","_NET_WM_STATE_HIDDEN","_NET_WM_STATE_SKIP_TASKBAR","_NET_WM_VISIBLE_ICON_NAME","_NET_WM_VISIBLE_NAME","_NET_WM_WINDOW_TYPE","_NET_WM_WINDOW_TYPE_DOCK","_NET_WORKAREA","_NET_WM_WINDOW_TYPE_DESKTOP","_NET_WM_WINDOW_TYPE_NORMAL","_NET_WM_STATE_STICKY","_NET_WM_STATE_MAXIMIZED_VERT","_NET_WM_STATE_MAXIMIZED_HORZ","UTF8_STRING","MOTIF_WM_HINTS","WM_CHANGE_STATE","WM_DELETE_WINDOW","WM_PROTOCOLS","WM_STATE","_NET_WM_WINDOW_TYPE_DIALOG","_NET_WM_WINDOW_TYPE_TOOL","WM_HINTS","_MOTIF_WM_HINTS","_WM_NORMAL_HINTS","_NET_WM_PID","_NET_WM_USER_TIME","WM_TRANSIENT_FOR","_XROOTPMAP_ID",NULL};
3131

3232
LFSWM2_Class::~LFSWM2_Class(void)
3333
{
@@ -286,6 +286,7 @@ void LFSWM2_Class::LFSWM2_initRootWindow(void)
286286
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_DELETE_WINDOW")),
287287
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_PROTOCOLS")),
288288
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_STATE")),
289+
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_HINTS")),
289290
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),
290291
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_WM_NORMAL_HINTS")),
291292
this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_XROOTPMAP_ID"))
@@ -782,14 +783,14 @@ void LFSWM2_Class::DEBUG_printCurrentHintsDataStruct(hintsDataStruct hs)
782783

783784
void LFSWM2_Class::DEBUG_printHintsDataStruct(Window wid)
784785
{
785-
hintsDataStruct hs;
786-
motifHints *hints=NULL;
786+
hintsDataStruct hs;
787+
motifHints *hints=NULL;
787788
long unsigned int nitems_return=0;
788789

789790
hints=(motifHints*)this->mainWindowClass->LFSWM2_getProp(wid,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),&nitems_return);
790791

791792
hs=this->mainWindowClass->LFSWM2_getWindowHints(wid);
792-
793+
793794
fprintf(stderr,"window=%p\n",wid);
794795

795796
if(hints!=NULL)

0 commit comments

Comments
 (0)