Re: [PATCH 3/8] Add the application to the wapp_list

2013-04-17 Thread Carlos R. Mafra
On Sun, 14 Apr 2013 at 23:13:28 +0200, Rodolfo García Peñas (kix) wrote:
 From: Rodolfo García Peñas (kix) k...@kix.es
 
 The screen has a list of applications:
 
 8
 kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list screen.h
 struct WApplication *wapp_list;/* list of all aplications */
 kix@debian:~/src/wmaker/wmaker-crm/src$
 8
 
 But this variable was not set before this patch:
 - Was removed in application.c
 - Local variable in session.c
 
 8
 kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list *.c
 application.c:  if (wapp == scr-wapp_list) {
 application.c:  scr-wapp_list = wapp-next;
 session.c:  WMArray *wapp_list = NULL;
 session.c:  wapp_list = WMCreateArray(16);
 session.c: (WMGetFirstInArray(wapp_list, (void *)appId) == 
 WANotFound
 session.c:   WMAddToArray(wapp_list, (void *)appId);
 session.c:  WMFreeArray(wapp_list);
 kix@debian:~/src/wmaker/wmaker-crm/src$
 8
 
 This variable is needed to restore the screen without re-create the
 applications structs.
 ---
  src/application.c |4 
  1 file changed, 4 insertions(+)
 
 diff --git a/src/application.c b/src/application.c
 index abe1d2d..6a03775 100644
 --- a/src/application.c
 +++ b/src/application.c
 @@ -143,6 +143,10 @@ WApplication *wApplicationCreate(WWindow * wwin)
  
   create_appicon_for_application(wapp, wwin);
  
 + /* Save the application in the application list */
 + wapp-next = scr-wapp_list;
 + scr-wapp_list = wapp;


If wapp_list was not set before then wapp-next will contain junk
at this point, no?


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


Re: [PATCH 3/8] Add the application to the wapp_list

2013-04-17 Thread Rodolfo García Peñas (kix)


Quoting Carlos R. Mafra crma...@gmail.com:


On Sun, 14 Apr 2013 at 23:13:28 +0200, Rodolfo García Peñas (kix) wrote:

From: Rodolfo García Peñas (kix) k...@kix.es

The screen has a list of applications:

8
kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list screen.h
struct WApplication *wapp_list;/* list of all aplications */
kix@debian:~/src/wmaker/wmaker-crm/src$
8

But this variable was not set before this patch:
- Was removed in application.c
- Local variable in session.c

8
kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list *.c
application.c:  if (wapp == scr-wapp_list) {
application.c:  scr-wapp_list = wapp-next;
session.c:  WMArray *wapp_list = NULL;
session.c:  wapp_list = WMCreateArray(16);
session.c: (WMGetFirstInArray(wapp_list, (void *)appId)
== WANotFound
session.c:   WMAddToArray(wapp_list, (void *)appId);
session.c:  WMFreeArray(wapp_list);
kix@debian:~/src/wmaker/wmaker-crm/src$
8

This variable is needed to restore the screen without re-create the
applications structs.
---
 src/application.c |4 
 1 file changed, 4 insertions(+)

diff --git a/src/application.c b/src/application.c
index abe1d2d..6a03775 100644
--- a/src/application.c
+++ b/src/application.c
@@ -143,6 +143,10 @@ WApplication *wApplicationCreate(WWindow * wwin)

create_appicon_for_application(wapp, wwin);

+   /* Save the application in the application list */
+   wapp-next = scr-wapp_list;
+   scr-wapp_list = wapp;



If wapp_list was not set before then wapp-next will contain junk
at this point, no?


Yes. Good point. We should initialize the wapp_list when wmaker starts.

This list is needed to re-position the windows, for example with
XRandR screen change.

We have a different list for appicons. See src-app_icon_list. Is the
same idea.

With XRandR, we should follow the app_icon_list to re-position the
appicons and then paint it (move them). And we should follow the
wapp_list to to the same with the windows.

I didn't found where the app_icon_list is initialized.

Cheers,
kix


Rodolfo García Peñas (kix)
http://www.kix.es/


--
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.


[PATCH 3/8] Add the application to the wapp_list

2013-04-14 Thread kix
From: Rodolfo García Peñas (kix) k...@kix.es

The screen has a list of applications:

8
kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list screen.h
struct WApplication *wapp_list;/* list of all aplications */
kix@debian:~/src/wmaker/wmaker-crm/src$
8

But this variable was not set before this patch:
- Was removed in application.c
- Local variable in session.c

8
kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list *.c
application.c:  if (wapp == scr-wapp_list) {
application.c:  scr-wapp_list = wapp-next;
session.c:  WMArray *wapp_list = NULL;
session.c:  wapp_list = WMCreateArray(16);
session.c: (WMGetFirstInArray(wapp_list, (void *)appId) == WANotFound
session.c:   WMAddToArray(wapp_list, (void *)appId);
session.c:  WMFreeArray(wapp_list);
kix@debian:~/src/wmaker/wmaker-crm/src$
8

This variable is needed to restore the screen without re-create the
applications structs.
---
 src/application.c |4 
 1 file changed, 4 insertions(+)

diff --git a/src/application.c b/src/application.c
index abe1d2d..6a03775 100644
--- a/src/application.c
+++ b/src/application.c
@@ -143,6 +143,10 @@ WApplication *wApplicationCreate(WWindow * wwin)
 
create_appicon_for_application(wapp, wwin);
 
+   /* Save the application in the application list */
+   wapp-next = scr-wapp_list;
+   scr-wapp_list = wapp;
+
return wapp;
 }
 
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.