Hi,

The current code is nice, but I was thinking about some things in wmaker and I 
am not sure if I am in the right way.

Now, some functions are very near of the X11 code, and IMO that is wrong. For 
example, to create the Clip, the current code creates the Clip struct, painting 
it in coords x=0,y=0, and some code later, move it to the final, right 
possition. Similar situations are easy to find, see the functions like 
wMenuMove (menu.c) or wCoreConfigure (wcore.c), to set the right possition of 
the elements.

In my oppinion, that is because we are not working with abstract objects that 
we have in memory and then, we paint in the right possition. That makes wmaker 
do some things twice (create + paint, and later, repaint).

I started to work in that direction, and I found some interesting things, but 
the work is too hard for only one person and... I am not sure that this work is 
right.

I made some patches (please, don't apply them, is only as demo) and I found 
some things that can be changed (some of the are not in the patches):

- Some code clean :-) (included in some patches)
- The function ExecuteShellCommand (main.c) and execCommand (session.c and 
dock.c) could be the same function more or less.
- Clip and Dock should be the same struct and used in the same way. Now, Dock 
is WDock, but Clip is WDock, but Clip is used as WAppIcon in some functions.
- I think some things about the XAttributes/vmask in wcore.c are not fine. I 
had problems with the border lines in the patches I wrote. Probably my patches 
are wrong, of course, but we set some attributes/vmaks in wcore.c, we create 
the item and then we set other attributes/vmask some lines after. Probably we 
can move that code to the wcore Create functions. See my patches please. 

But the most important part is:

- I added some abstraction to functions.
  - Some items (as docks) are created in the right place, we don't need move it 
later
- Some functions, at least the main functions about the item creation, don't 
have X11 code, only abstract code.
- This abstraction could be used for Multi-Header or xrandr, because the items 
and the real-screen are independent.

But, I am not sure if I am becoming crazy /-)

Patches are attached, enjoy them. I didn't add many comments because that was 
only a PoC, but after 69 patches I thought that I had a problem. I removed some 
patches and rebase others, but (sorry) I didn't add comments. Anyway, the idea 
is easy, the code is step-by-step and it doesn't include big changes, and you 
can follow the idea without problems. I only moved some lines from one 
functions to others, to put the X11 at the end of the item creation. You can 
use kdiff or other visual diff applications to see the code. There are not too 
much changes really. Some files have the name in spanish, but inside the 
description is in english.

Cheers,
kix
-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/

Attachment: pts.tgz
Description: Binary data

Reply via email to