PDA

View Full Version : Emerald modification - Window Rules?


e-izmir-a
January 3rd, 2008, 05:41 PM
Hallo every body... I have I "little" problem...
You all know the Transparent Windows on Windows Vista like in the Windows Explorer. There is a search field and path field over the transparent window.

I missed this feature in Linux *g* So I have just started to code with a "good" result:

http://img222.imageshack.us/img222/7379/screenshot1qa2.th.png (http://img222.imageshack.us/my.php?image=screenshot1qa2.png)

But for this result, I have to disable inner lines in Emerlad Engine - vrunner, and draw them directly in my Application:

http://img217.imageshack.us/img217/6632/screenshot2nt7.th.png (http://img217.imageshack.us/my.php?image=screenshot2nt7.png)

So It is terrible in all the other application, because there is no inner line (I know I have disabled them):

http://img228.imageshack.us/img228/2343/screenshot3yo2.png (http://imageshack.us)

So I have to find a good solution....
I have get the source of emerald 0.5.2 and looked for the vrunner engine and find the line, where draws the inner line. So I thought I had implement a "window rule" function...

But I have NO ideas, how to get the WM_CLASS of any Window (I know XGetClassHint() is enough, have no window parameter)...

I'ld like to get only the WM_CLASS of the current window, nothing else!

SO my question is, how to get the WM_CLASS of current Window?

Ercan

some-guy
January 3rd, 2008, 07:30 PM
http://forlong.blogage.de/article/2007/12/13/Support-for-transparency-in-GTK-on-the-horizon#

e-izmir-a
January 3rd, 2008, 07:36 PM
I know these one, but I will only find out the WM_CLASS name of the current decorated window, nothing else ^^

Ercan

some-guy
January 3rd, 2008, 07:50 PM
First off, don't try, emerald is a mess, the devs have mentioned it countless times, there is going to be a new decorator

If you want that to be part of the application, write it in GTK+, and when the new murrine engine comes out, make a theme for it ;)

e-izmir-a
January 3rd, 2008, 08:13 PM
The new Murrine Engine will not be integrated with the window decorator.
But I will integrade the window manager with the application ;)

Thats my Problem...

Is there any other solutions to make the inner lines without modifying the source code of emerald?

Whats about a GTK Theme? Can I add the inner lines with it?
Maybe with "widget_class" or something else?
Can I modify or add an background image to GtkWindow?

Ercan

some-guy
January 3rd, 2008, 08:25 PM
The new Murrine Engine will not be integrated with the window decorator.
But I will integrade the window manager with the application ;)
Just make an emerald theme that blends in perfectly with the gtk theme, as for the background thing, I don't know :(
EDIT: Nautilus can draw backgrounds, so I guess you can...

e-izmir-a
January 3rd, 2008, 09:09 PM
But when I make the inner lines with Emerald, then my "work" looks very bad, see:

http://img223.imageshack.us/img223/6588/screenshot3xz3.th.png (http://img223.imageshack.us/my.php?image=screenshot3xz3.png)

exactly that is my big problem... When I enable the inner lines in emerald theme, that looks like the picture. But when I disable the inner lines, than the other applications don't have the inner lines. Thats not good.

Thats why I have started this thread ^^ I need Technical help, but till now I got only theoretical help *g*

Ercan

some-guy
January 3rd, 2008, 10:02 PM
hopefully something that works will come in the new decorator http://forum.compiz-fusion.org/showthread.php?t=6324

Sorry, but I'm no dev :( (wish I was though...)

Deciare
January 4th, 2008, 09:41 PM
There's an example of how to use XGetClassHint() in Compiz's source code at src/window.c (http://gitweb.opencompositing.org/?p=compiz;a=blob;f=src/window.c;h=2379152aab1c95eb2959489753d4d74524846de 5;hb=HEAD) (in updateWindowClassHints(), line 347).

I'm not sure how to find the X ID for the currently active window, though. XGetInputFocus(), maybe? Compiz does it only once, so the rest of the time, it's probably internally stored somewhere.

e-izmir-a
January 4th, 2008, 10:49 PM
Thank you, I have already tried XGetClassHint, but XGetClassHint needs a window ( Window w; ) and I haven't found the window anywhere in the emerald source... Maybe you know where it is?

And my next question is about cairo. I have a big problem to draw a simple line with 1 px line-width...

so here my result:

http://img228.imageshack.us/img228/2245/screenshot1mb4.th.png (http://img228.imageshack.us/my.php?image=screenshot1mb4.png)

and the code I used:

/* Ränder werden gezeichnet */
cairo_set_line_width (cr, 1);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
cairo_move_to (cr, 0.0, 0.0);
cairo_rectangle (cr, 0.0 , e_main_ws.titlesize, e_main_ws.cur_width, e_main_ws.cur_height-41);
cairo_stroke (cr);

where is my mistake?

I would be very happy when I get a solution ^^

Ercan

Deciare
January 4th, 2008, 11:19 PM
Did XGetInputFocus() not work out? I wasn't sure if it provided the right kind of window ID, or if it would provide the ID for the correct window.

Emerald's source code doesn't seem to contain any references to specific windows. It looks as though Compiz's decoration plugin decides which decoration to request Emerald to draw based on whether it is active or not.

Doesn't Cairo draw in vectors? Line width may not be calculated in pixels, but in some other unit of measurement. Maybe inches? Try a floating-point value, or using a function that specifically measures in pixels. I don't know if such a function would exist, or what it'd be called, though... I've never written a single line of Cairo code before.

e-izmir-a
January 4th, 2008, 11:35 PM
It's 00:33 clock here in Germany, and I cant think at this time.
I'll looking for Compiz Decorator Plugin ans maybe a found the window refrence tomorow.
It would be grate when I can implement a window rule checking in emerald.

I'll looking for cairo too.

Good night every body ;)

Edit:

I have just found this line at the vrunner-engine source code:

// inner border
//TODO - make this a bit more pixel-perfect...but it works for now

cairo_set_line_width (cr, 1.0);

cairo_move_to (cr, pleft + pwidth + 1.5, ptop - 1);
cairo_rel_line_to (cr, -pwidth - 2.5, 0);
cairo_rel_line_to (cr, 0, pheight + 2.5);
cairo_set_source_alpha_color (cr, &pfs->contents_shadow);
cairo_stroke (cr);

I mean, 1.0 must be right...

Edit2:

I have found the problem, I dont know why, but the X and Y coordinates must be a odd number... for example 10,5

Ercan

b0le
January 5th, 2008, 12:19 AM
Look at cairo faq (it has something in there about that)

e-izmir-a
January 5th, 2008, 12:25 AM
Look at cairo faq (it has something in there about that)

I have found this gold-weight information from the cairo API and I just tested it.

It looks great:

http://img143.imageshack.us/my.php?image=screenshot2dq5.png

Ercan

shafin
January 5th, 2008, 12:45 AM
Can we get it?

Thanks

e-izmir-a
January 5th, 2008, 01:02 AM
Can we get it?

Thanks

It is not finished yet ;)

I'm working on the emerald modification, and then I can publish the source code.
So the devs can make or modifiy applications, like "vista" look.

Ercan

DARKGuy
March 31st, 2008, 09:31 AM
Sorry for the bump on this old thread (and I just registered to reply on this thread XD)... but, has there been any progress on this? what's the status? I'd love to have that effect on my current desktop! :D

DARKGuy
April 6th, 2008, 04:37 AM
Nothing yet?

e-izmir-a
May 7th, 2008, 08:35 PM
After few month I am back.... The reason why I havent answered is, that my PC have had a total crash, so I had to buy me a new PC...

I will work on my project for the next weeks ;)

Ercan