Re: [compiz] Why doesn't compiz honor special window settings?

2008-01-27 Thread Bellegarde Cedric
Le Sat, 26 Jan 2008 22:15:36 -0600,
David C. Rankin [EMAIL PROTECTED] a écrit :

 Listmates,
 
   I have a problem with compiz not honoring the special window
 settings in kde for xterm. In kde, I have the position and size of
 the xterm window set to a usable default. In KDE, the window opens to
 the proper size and location. In compiz, it is about 1/2 the size and
 never opens where it is set to open.
 
   Is there a way to have compiz read the default window
 settings for xterm?
 
   Just a curiosity.
 

Are you sure it's not a probleme with your placement plugins settings?

Working here...

Cédric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] activateWindow() and shaded windows

2008-01-22 Thread Bellegarde Cedric
Is there a particular reason for having this code in activateWindow
function (window.c 4212)?

  if (w-state  CompWindowStateHiddenMask)
{   
w-state = ~CompWindowStateShadedMask;
if (w-shaded)
showWindow (w);
}

It brake scale plugin unshading shaded windows on plugin terminate...
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Transparent windows on the web?

2008-01-13 Thread Bellegarde Cedric
When i go on picasa with compiz, epiphany go transparent!

Same with firefox and opera ... :(

Here a video:
http://hibbert.univ-lille3.fr/~cbellegarde/compiz.ogg
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Check behaviour of Compiz Fusion KDE 0.6.2-3.1

2007-11-19 Thread Bellegarde Cedric
Le Mon, 19 Nov 2007 17:43:12 +0100,
Markus Elfring [EMAIL PROTECTED] a écrit :

 Check behaviour of Compiz Fusion KDE 0.6.2-3.1
 
 Hello,
 
 I am trying out the release Compiz Fusion KDE 0.6.2-3.1 on my
 openSUSE system. I would like to share some more experiences about
 its usability.
 
 1. Context menu by title bar
 1.1 The context/actions menu that appears after a right click on the
 window title is displayed in English despite German is my primary
 language in the regional settings.
 I assume that translations will be improved in the near future.

Suse issue...

 1.2 The menu To Desktop shows only two entries. The KDE desktop
 switcher applet offers me eight buttons for workplaces.

You have 2 desktop and 4 viewports, it's normal...

 1.3 I can move a window to the desktop 2. This has got the unexpected
 effect that it vanishes from the title list by the KDE control bar.
 Is the task bar setting Show windows from all desktops not
 respected?

Kde bug... (viewport support)

 1.4 A similar effect can happen if I switch to the second desktop.
 The titles from the first desktop are not shown.
 The pager seems also to forget the first one.

Kde bug... (viewport support)

 3. Application switching
 It can happen that a garbled preview is displayed after several
 switches with the key Alt+Tab.

No problem here so it may be a bug in your driver
 
 4. After a reboot
 4.1 The item Compiz Fusion Icon is not automatically executed after
 a login because I did not put it into the autostart. But the eight
 workplace buttons are still displayed by the KDE desktop switcher
 applet.

Because you select compiz in kdm?

 4.2 If I click on 2, the KDE control bar is not visible any more on
 the second desktop (even no panel-hiding button). I expect that it
 should stay accesible on all my desktops on the top.

Kde bug... (viewport support)

 4.3 If I return to the first desktop by scrolling with the mouse
 wheel, the button number is resetted to the value that was specified
 by the setting Number of desktops.

Kde bug... (viewport support)

 Regards,
 Markus

To use viewport with kde, use this:

http://kde-apps.org/content/show.php/taskbar-compiz?content=49484
http://kde-apps.org/content/show.php/kicker-compiz?content=46021

Cédric.
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] added key bindings for window raise/lower

2007-09-25 Thread Bellegarde Cedric
I think you should look at extrawm compiz-fusion plugin if you want to
add such features... 

Cédric

Le mardi 25 septembre 2007 à 07:42 +1000, Pigeon a écrit :
 Hi all,
 
 
 Did a pretty simple patch to allow raising/lowering window using key
 bindings, which I personally use a lot in other window managers.
 
 As simple as it is, it changes the size of the _CompDisplay so we
 probably need to bump up the abi version if this is accepted?
 
 Thanks.
 
 
 Pigeon.
 
 ___
 compiz mailing list
 compiz@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/compiz


___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] Add opacity limits

2007-07-29 Thread Bellegarde Cedric
Le dimanche 29 juillet 2007, Erkin Bahceci a écrit :
 Why
 would you want an invisible window that blocks interaction with the
 windows behind it?

Hmm, here i use 0% opacity to hide gtk tooltips as it's not available as an 
option...

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] Fix placement mode option

2007-06-24 Thread Bellegarde Cedric
In current git, placement mode option isn't working.

This patch fix this issue.

Cedric
diff --git a/plugins/place.c b/plugins/place.c
index deb5376..0708eed 100644
--- a/plugins/place.c
+++ b/plugins/place.c
@@ -30,6 +30,13 @@
 
 static CompMetadata placeMetadata;
 
+#define PLACE_MODE_CASCADE  0
+#define PLACE_MODE_CENTERED 1
+#define PLACE_MODE_SMART2
+#define PLACE_MODE_MAXIMIZE 3
+#define PLACE_MODE_RANDOM   4
+#define PLACE_MODE_LAST PLACE_MODE_RANDOM
+
 typedef enum {
 PlaceModeCascade  = 0,
 PlaceModeCentered = 1,
@@ -65,7 +72,6 @@ typedef struct _PlaceScreen {
 
 PlaceWindowProc placeWindow;
 
-PlaceMode placeMode;
 } PlaceScreen;
 
 #define GET_PLACE_DISPLAY(d)  \
@@ -171,10 +177,7 @@ placeSetScreenOption (CompPlugin  *plugin,
 switch (index) {
 case PLACE_SCREEN_OPTION_MODE:
 	if (compSetIntOption (o, value))
-	{
-	ps-placeMode = value-i;
 	return TRUE;
-	}
 	break;
 case PLACE_SCREEN_OPTION_POSITION_MATCHES:
 case PLACE_SCREEN_OPTION_VIEWPORT_MATCHES:
@@ -1236,7 +1239,7 @@ placeWin (CompWindow *window,
 
 if (!placeMatchPosition (window, x, y))
 {
-	switch (ps-placeMode) {
+	switch (ps-opt[PLACE_SCREEN_OPTION_MODE].value.i) {
 	case PlaceModeCascade:
 	if (find_first_fit (window, windows, x, y, x, y))
 		goto done_check_denied_focus;
@@ -1422,7 +1425,7 @@ placeFiniDisplay (CompPlugin  *p,
 
 static const CompMetadataOptionInfo placeScreenOptionInfo[] = {
 { workarounds, bool, 0, 0, 0 },
-{ mode, int, RESTOSTRING (0, PlaceModeNum - 1), 0, 0 },
+{ mode, int, RESTOSTRING (0, PLACE_MODE_LAST), 0, 0 },
 { position_matches, list, typematch/type, 0, 0 },
 { position_x_values, list, typeint/type, 0, 0 },
 { position_y_values, list, typeint/type, 0, 0 },
@@ -1457,8 +1460,6 @@ placeInitScreen (CompPlugin *p,
 
 WRAP (ps, s, placeWindow, placePlaceWindow);
 
-ps-placeMode = 0;
-
 return TRUE;
 }
 
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] Fix placement mode option

2007-06-24 Thread Bellegarde Cedric
Le dimanche 24 juin 2007, Bellegarde Cedric a écrit :
 In current git, placement mode option isn't working.

 This patch fix this issue.

 Cedric

Hmm, i just miss to remove the old placeMode struct :(

Just Open your eyes and wake up before sending a patch...

Cedric
diff --git a/plugins/place.c b/plugins/place.c
index deb5376..f7d9cca 100644
--- a/plugins/place.c
+++ b/plugins/place.c
@@ -30,14 +30,12 @@
 
 static CompMetadata placeMetadata;
 
-typedef enum {
-PlaceModeCascade  = 0,
-PlaceModeCentered = 1,
-PlaceModeSmart= 2,
-PlaceModeMaximize = 3,
-PlaceModeRandom   = 4,
-PlaceModeNum
-} PlaceMode;
+#define PLACE_MODE_CASCADE  0
+#define PLACE_MODE_CENTERED 1
+#define PLACE_MODE_SMART2
+#define PLACE_MODE_MAXIMIZE 3
+#define PLACE_MODE_RANDOM   4
+#define PLACE_MODE_LAST PLACE_MODE_RANDOM
 
 /* overlap types */
 #define NONE0
@@ -65,7 +63,6 @@ typedef struct _PlaceScreen {
 
 PlaceWindowProc placeWindow;
 
-PlaceMode placeMode;
 } PlaceScreen;
 
 #define GET_PLACE_DISPLAY(d)  \
@@ -171,10 +168,7 @@ placeSetScreenOption (CompPlugin  *plugin,
 switch (index) {
 case PLACE_SCREEN_OPTION_MODE:
 	if (compSetIntOption (o, value))
-	{
-	ps-placeMode = value-i;
 	return TRUE;
-	}
 	break;
 case PLACE_SCREEN_OPTION_POSITION_MATCHES:
 case PLACE_SCREEN_OPTION_VIEWPORT_MATCHES:
@@ -1236,8 +1230,8 @@ placeWin (CompWindow *window,
 
 if (!placeMatchPosition (window, x, y))
 {
-	switch (ps-placeMode) {
-	case PlaceModeCascade:
+	switch (ps-opt[PLACE_SCREEN_OPTION_MODE].value.i) {
+	case PLACE_MODE_CASCADE:
 	if (find_first_fit (window, windows, x, y, x, y))
 		goto done_check_denied_focus;
 
@@ -1246,16 +1240,16 @@ placeWin (CompWindow *window,
 	 */
 	find_next_cascade (window, windows, x, y, x, y);
 	break;
-	case PlaceModeCentered:
+	case PLACE_MODE_CENTERED:
 	placeCentered (window, work_area, x, y);
 	break;
-	case PlaceModeRandom:
+	case PLACE_MODE_RANDOM:
 	placeRandom (window, work_area, x, y);
 	break;
-	case PlaceModeSmart:
+	case PLACE_MODE_SMART:
 	placeSmart (window, work_area, x, y);
 	break;
-	case PlaceModeMaximize:
+	case PLACE_MODE_MAXIMIZE:
 	maximizeWindow (window, MAXIMIZE_STATE);
 	break;
 	default:
@@ -1422,7 +1416,7 @@ placeFiniDisplay (CompPlugin  *p,
 
 static const CompMetadataOptionInfo placeScreenOptionInfo[] = {
 { workarounds, bool, 0, 0, 0 },
-{ mode, int, RESTOSTRING (0, PlaceModeNum - 1), 0, 0 },
+{ mode, int, RESTOSTRING (0, PLACE_MODE_LAST), 0, 0 },
 { position_matches, list, typematch/type, 0, 0 },
 { position_x_values, list, typeint/type, 0, 0 },
 { position_y_values, list, typeint/type, 0, 0 },
@@ -1457,8 +1451,6 @@ placeInitScreen (CompPlugin *p,
 
 WRAP (ps, s, placeWindow, placePlaceWindow);
 
-ps-placeMode = 0;
-
 return TRUE;
 }
 
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] Resize plugin not finishing resizing

2007-06-23 Thread Bellegarde Cedric
In current git, when starting a resize and finish it without any change, 
resizeTerminate() need to do a resizeDamageRectangle().

This patch fix the issue...

Cedric
diff --git a/plugins/resize.c b/plugins/resize.c
index a078861..ba4ed81 100644
--- a/plugins/resize.c
+++ b/plugins/resize.c
@@ -471,7 +471,12 @@ resizeTerminate (CompDisplay	 *d,
 	}
 	else
 	{
-	if (state  CompActionStateCancel)
+	if (state  CompActionStateCancel ||
+		( rd-geometry.x  == rd-savedGeometry.x 
+		  rd-geometry.y  == rd-savedGeometry.y 
+		  rd-geometry.width  == rd-savedGeometry.width 
+		  rd-geometry.height == rd-savedGeometry.height
+		))
 	{
 		BoxRec box;
 
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] decoration broken in current git (was Re: place plugin)

2007-05-26 Thread Bellegarde Cedric
Le samedi 26 mai 2007, dragoran a écrit :
 ok, the problem seems unleated to the changes I was trying to make but
 the decoration does not work in the current git at all.
 last working version (which I am using now: 20070518).
 any recent changes that might have broke it?
 ___
 compiz mailing list
 compiz@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/compiz

i'm using current git and decoration plugin is working here...

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Recent but in gtk-window-decorator painting

2007-04-22 Thread Bellegarde Cedric
Since recent change in git, i've got a bug with gtk-window-decorator:
http://hibbert.univ-lille3.fr/~cbellegarde/gwd.png

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Strange behaviour in move plugin

2007-04-22 Thread Bellegarde Cedric
Le dimanche 22 avril 2007, Erkin Bahceci a écrit :
 The problem is always repeatable and is pretty annoying.

I'm happy to see that i'm not the only one to have this problem.

Currently, i'm using the old move plugin:
http://hibbert.univ-lille3.fr/~cbellegarde/Compiz/bouge.tar.gz

For me, testing with this one and current move plugin really make a big 
difference while moving windows...

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] re-work option initialization

2007-03-29 Thread Bellegarde Cedric
Le jeudi 29 mars 2007, Dennis Kasprzyk a écrit :
 Currently there are two types of configuration tools. Some with fixed
 functionality and some autogenerated. To improve the quality of the
 autogenerated tools I would like to make this proposal about additional
 values in the CompOption struct and the plugin vtable.

I really disagree with this...

First, i dislike the way compiz deal with options descriptions. Why put this 
in the code?

Just look how kde deal with this: kcfg file (xml files 
in /usr/share/config.kcfg), it's much cleaner i think. 
I would prefer one xml description file per plugin usable by configuration 
tools.

We can have tools that create gconf schemas and ini conf files based on this 
xml files.

I don't see any reason having such information in the code, but maybe i'm 
missing something...

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [BUG] gtk-window-decorator and Xevents

2007-03-10 Thread Bellegarde Cedric
If i remove Move action mask with winrules plugin, I can't raise a window by 
clicking on it.

event_filter_func() receive an KeymapNotify instead of 
ButtonPress/ButtonRelease event.

gtk-window-decorator bug? libwnck bug? gdk bug?

No idea for now :(

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [BUGS] Kde window decorator

2007-03-10 Thread Bellegarde Cedric
Thanks to last david modifications (fixing an important bug for me), i just 
jump to kde decorator.

But i always have two bugs:

1)
I've got some artefacts with wobbly windows at window/decoration junction. 
Better visibility of this bug with polyester theme and unified 
decorator/window color like on this screenshot:
http://hibbert.univ-lille3.fr/~cbellegarde/kde.png
This doesn't happen when using Alt + click to move window !

I think the white line on konqueror maximised window is the same bug:
http://hibbert.univ-lille3.fr/~cbellegarde/kde1.png

And i get to have a screenshot of the bug:
http://hibbert.univ-lille3.fr/~cbellegarde/kde2.png

2)
With plastik, maximised window bar is misplaced:
http://hibbert.univ-lille3.fr/~cbellegarde/bug_plastik.png


___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] decoration plugin window matching

2007-03-05 Thread Bellegarde Cedric
Here a patch to enable window matching in decoration plugin:

http://hibbert.univ-lille3.fr/~cbellegarde/Compiz/decor_match.patch

And a shema file if you want to test:
http://hibbert.univ-lille3.fr/~cbellegarde/Compiz/decor.schema

For removing shadow on panels, just add type=dock to no_border_match

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] place plugin window matching

2007-03-05 Thread Bellegarde Cedric
Here a patch to enable window position/viewport matching in place plugin:

http://hibbert.univ-lille3.fr/~cbellegarde/Compiz/place_matches.patch

I don't know how to initialise properly x and y position max value in options 
initialisation.

David may have an idea ;)

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] place plugin window matching

2007-03-05 Thread Bellegarde Cedric
Le lundi 5 mars 2007, vous avez écrit :
 The patch was good, I just wanted to reduce some
 code and make it possible to match both vertical and horizontal viewport
 position

So here my question, what is a vertical viewport position? I can see the 
concept in some WM, but in compiz...

 . I haven't actually tried the changes I put in :) so please let 
 me know if it's not working correctly.

Just a little mistake ;)
http://hibbert.univ-lille3.fr/~cbellegarde/Compiz/place_mistake.patch

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] [PATCH] Grab state Last state remembering

2007-03-05 Thread Bellegarde Cedric
Le lundi 5 mars 2007, David Reveman a écrit :
 I've applied the patch. However, all code that cause a change to the
 state should be modified so that a mask of changed bits can be passed to
 the state change notify function instead. This lastState variable
 shouldn't have to exist.

This patch should be removed i think.

http://forum.go-compiz.org/viewtopic.php?p=5071#5071

I just post a version of group plugin working without lastState from core.

Danny, you can save previous window state in GroupWindow instead of core: look 
at previousState variable i add.

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] [PATCH] prevention focus obsolete

2007-03-02 Thread Bellegarde Cedric
http://hibbert.univ-lille3.fr/%7Ecbellegarde/Compiz/prevention.patch

Here a patch to remove focus_prevention option. Put a zero string in 
focus_prevention_match do the same.

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Final version of placement enhancement

2007-03-01 Thread Bellegarde Cedric
David Reveman wrote:
 Thanks,

 you were not returning TRUE after successfully updating the mode option

I'm stupid, it was corrected, don't know why i don't get it in final version.

 and I didn't like the way you used a macro to get the work area in each
 placement function. 

Yes, it was bad, now with your commit, i know understand how multihead works.

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Blur bugs and slowdown :(

2007-02-28 Thread Bellegarde Cedric
Le mercredi 28 février 2007, vous avez écrit :
 I can't reproduce that. Does you driver support
 GL_ARB_texture_non_power_of_two?

Yes :(

Cedric

___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] window matching interface and the new match option

2007-02-27 Thread Bellegarde Cedric
On Tuesday 27 February 2007 15:03:02 Mike Dransfield wrote:
  It just sets the atoms
 which core responds to, so it is just a hack.

It's exactly what is doing compiz core with opacity...

Look at increaseSaturation() and inceaseOpacity(), the code is the same... So 
bs code comes from compiz core, i see no reason to have this in core...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Zoom plugin filter linear?

2007-02-13 Thread Bellegarde Cedric
http://gitweb.freedesktop.org/?p=xorg/app/compiz.git;a=blobdiff;h=7ebfdccdaccfe12749e7123fba5271f430fb9e5f;hp=59d3ce75d24296751120916144c057114fad1f14;hb=d32ac34676f2a87d60ad9e4fe426281595c5b859;f=plugins/zoom.c

David, when you add my zoom plugin patch factor, you add this:

+if (zs-zoomFactor == 2.0f 
+(zs-opt[ZOOM_SCREEN_OPTION_FILTER_LINEAR].value.b ||
+ zs-zVelocity != 0.0f))
 s-filter[SCREEN_TRANS_FILTER] = COMP_TEXTURE_FILTER_GOOD;
 else
 s-filter[SCREEN_TRANS_FILTER] = COMP_TEXTURE_FILTER_FAST;

It make filter linear disabled when zoom factor != 2 :(
Any reason? I remove this and it seems to work well here.

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Final version of placement enhancement

2007-02-08 Thread Bellegarde Cedric
Le jeudi 8 février 2007, Bellegarde Cedric a écrit :
 http://forum.go-compiz.org/viewtopic.php?p=3783

 Seems to be buggy in multihead, but i can't test here ...

http://puffy.homelinux.org/~gnumdk/compiz/patch/place.patch

I modify my patch following mcook idea for multihead.
http://forum.go-compiz.org/viewtopic.php?p=3846#3846

I hope it now works with multi ouputs...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] A patch for minimize plugin.

2007-02-07 Thread Bellegarde Cedric
On Wednesday 07 February 2007 02:02:26 David Reveman wrote:
 minimize plugin modifying opacity attribute like that is wrong. fade
 plugin should be modified if you want to disable fading when windows are
 minimized.

It should be cool if you work on this  Stjepan ;)

Currently, i have to disable Normal windows in fade configuration if i want 
minimize effect to be draw correctly...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Final version of placement enhancement

2007-02-07 Thread Bellegarde Cedric
Le mercredi 7 février 2007 17:44, Bellegarde Cedric a écrit :
 When do i have to use this for aFunctionName() and when do i have to use
 this for a_function_name() ?

After looking at others plugins, NEVER! :)

So, here is complete version of my placement patch, it include:
- Some code cleanup, place plugin was using this_function_naming_method. I 
assume it's wrong as i can't see another exemple in compiz code. David, if i 
am wrong, i have a version of this patch without this code cleanup ;)
- Six placement method: Cascade, Centered, Random, LeftCorner, Maximize and 
Smart!

Centered, Random, LeftCorner and Maximize are really simple.
For smart placement, i adapt kwin code as requested by David.

I think it works, tell me if you have problems with it!

Cedric.
--- compiz_git/plugins/place.c	2007-02-07 19:01:36.0 +0100
+++ compiz/plugins/place.c	2007-02-07 19:17:26.0 +0100
@@ -22,6 +22,7 @@
 
 #include math.h
 #include stdlib.h
+#include string.h
 
 #include compiz.h
 
@@ -29,6 +30,33 @@
 
 #define PLACE_WORKAROUND_DEFAULT TRUE
 
+typedef enum
+{
+PlaceModeCascade,
+PlaceModeCentered,
+PlaceModeSmart,
+PlaceModeLeftCorner,
+PlaceModeMaximize,
+PlaceModeRandom,
+} PlaceMode;
+
+char *placeModes[] = {
+N_(Cascade),
+N_(Centered),
+N_(Smart),
+N_(LeftCorner),
+N_(Maximize),
+N_(Random)
+};
+
+#define PLACE_MODE_DEFAULT PlaceModeCascade
+#define NUM_PLACE_MODES (sizeof (placeModes) / sizeof (placeModes[0]))
+
+/* overlap types */
+#define NONE0
+#define H_WRONG -1
+#define W_WRONG -2 
+
 static int displayPrivateIndex;
 
 typedef struct _PlaceDisplay {
@@ -37,12 +65,14 @@
 } PlaceDisplay;
 
 #define PLACE_SCREEN_OPTION_WORKAROUND 0
-#define PLACE_SCREEN_OPTION_NUM1
+#define PLACE_SCREEN_OPTION_MODE   1
+#define PLACE_SCREEN_OPTION_NUM2
 
 typedef struct _PlaceScreen {
 CompOption opt[PLACE_SCREEN_OPTION_NUM];
 
 DamageWindowRectProc damageWindowRect;
+int placeMode;
 } PlaceScreen;
 
 #define GET_PLACE_DISPLAY(d)  \
@@ -87,6 +117,16 @@
 case PLACE_SCREEN_OPTION_WORKAROUND:
 	if (compSetBoolOption (o, value))
 	return TRUE;
+	break;
+case PLACE_SCREEN_OPTION_MODE:
+if (compSetStringOption (o, value)) 
+	{
+int i;
+for (i = 0; i  o-rest.s.nString; i++)
+if (strcmp (placeModes[i], o-value.s) == 0)
+ps-placeMode = (PlaceMode) i;
+	}
+	break;
 default:
 	break;
 }
@@ -105,6 +145,16 @@
 o-longDesc	 = N_(Window placement workarounds);
 o-type	 = CompOptionTypeBool;
 o-value.b	 = PLACE_WORKAROUND_DEFAULT;
+
+o = ps-opt[PLACE_SCREEN_OPTION_MODE];
+o-name = place_mode;
+o-shortDesc = N_(Placement Mode);
+o-longDesc =
+N_(Values: Cascade, Centered, LeftCorner, Smart, Maximize and Random);
+o-type = CompOptionTypeString;
+o-value.s = strdup (placeModes[PLACE_MODE_DEFAULT]);
+o-rest.s.string = placeModes;
+o-rest.s.nString = NUM_PLACE_MODES;
 }
 
 typedef enum {
@@ -152,7 +202,7 @@
 }
 
 static gint
-northwestcmp (gconstpointer a,
+northWestCmp (gconstpointer a,
 	  gconstpointer b)
 {
 CompWindow *aw = (gpointer) a;
@@ -181,31 +231,31 @@
 
 
 static void
-get_workarea_of_current_output_device (CompScreen *s,
-   XRectangle *area)
+getWorkareaOfCurrentOutputDevice (CompScreen *s,
+  XRectangle *area)
 {
 getWorkareaForOutput (s, s-currentOutputDev, area);
 }
 
 static int
-get_window_width (CompWindow *window)
+getWindowWidth (CompWindow *window)
 {
 return window-serverWidth + window-serverBorderWidth * 2;
 }
 
 static int
-get_window_height (CompWindow *window)
+getWindowHeight (CompWindow *window)
 {
 return window-serverHeight + window-serverBorderWidth * 2;
 }
 
 static void
-find_next_cascade (CompWindow *window,
-		   GList  *windows,
-		   intx,
-		   inty,
-		   int*new_x,
-		   int*new_y)
+findNextCascade (CompWindow *window,
+		 GList  *windows,
+		 intx,
+		 inty,
+		 int*new_x,
+		 int*new_y)
 {
 GList  *tmp;
 GList  *sorted;
@@ -216,7 +266,7 @@
 XRectangle work_area;
 
 sorted = g_list_copy (windows);
-sorted = g_list_sort (sorted, northwestcmp);
+sorted = g_list_sort (sorted, northWestCmp);
 
 /* This is a fuzzy cascade algorithm.
  * For each window in the list, we find where we'd cascade a
@@ -237,16 +287,16 @@
  * of NW corner of window frame.
  */
 
-get_workarea_of_current_output_device (window-screen, work_area);
+getWorkareaOfCurrentOutputDevice (window-screen, work_area);
 
 cascade_x = MAX (0, work_area.x);
 cascade_y = MAX (0, work_area.y);
 
 /* Find first cascade position that's not used. */
 
-window_width = get_window_width (window) + window-input.left +
+window_width = getWindowWidth (window) + window-input.left +
 	window-input.right;
-window_height = get_window_height

Re: [compiz] Final version of placement enhancement

2007-02-07 Thread Bellegarde Cedric
Le mercredi 7 février 2007, Bellegarde Cedric a écrit :
 I think it works, tell me if you have problems with it!

One day i will be able to send a good patch the first time ;)

So, after looking at place.c, it seems that also variables use this_notation.

So, here the patch without code cleanup, i will wait David behaviour about 
this.

I also fix a bug in placeRandom()

And now, i put the patch on my server, it will me prevent me to send you a 
message everytime i find something to fix ;)

http://puffy.homelinux.org/~gnumdk/compiz/patch/place.patch

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Final version of placement enhancement

2007-02-07 Thread Bellegarde Cedric
On Thursday 08 February 2007 01:00:09 Bellegarde Cedric wrote:
 And now, i put the patch on my server, it will me prevent me to send you a
 message everytime i find something to fix ;)

 http://puffy.homelinux.org/~gnumdk/compiz/patch/place.patch


http://forum.go-compiz.org/viewtopic.php?p=3783

Seems to be buggy in multihead, but i can't test here ...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] focus prevention in compiz vs. metacity

2007-01-21 Thread Bellegarde Cedric
Le samedi 20 janvier 2007 12:03, dragoran a écrit :
 Hello,
 I am using the current git compiz and noticed the new focus preventing
 feature.
 It works fine but:
 Metacity marks the new window as new (by blinking in the taskbar, and
 removing this state after the window is opened) while compiz does not do
 this (=user may not notice the new opened window).
 Any plans to add this feature to compiz?
 ___
 compiz mailing list
 compiz@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/compiz


Another question, is it possible to disable focus prevention?

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Somes patchs

2007-01-16 Thread Bellegarde Cedric
Here two patch:

A patch for switcher to disable window list. All was already present in code, 
just missing an option :)

A patch for place, it's my old patch, i just fix a stupid segfault!
Will try to add some others placement modes...

http://puffy.homelinux.org/%7Egnumdk/compiz/patch/switcher.patch
http://puffy.homelinux.org/%7Egnumdk/compiz/patch/place.patch

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Somes patchs

2007-01-16 Thread Bellegarde Cedric
Le mardi 16 janvier 2007 14:22, Bellegarde Cedric a écrit :
 http://puffy.homelinux.org/%7Egnumdk/compiz/patch/place.patch

Some precisions, place patch now add Centered  Random placement modes...

I'm will try to add Smart placement soon, if it's not too hard/ugly/...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Thumbnail plugin

2007-01-11 Thread Bellegarde Cedric
Le mercredi 10 janvier 2007 17:55, David Reveman a écrit :
 Let me know what you think about the my suggestions and keep up the good
 work.

It should be cool to have a way to get thumbnail of minimized windows too...
Beryl has just fork thumbnail plugin (so sad...), they seems to use pixmap to 
get thumbnail of minimised window (with some beryl core modifications). I 
think i prefer no thumbnail than a mix with live/pixmap thumbnails.

So, it will be cool to have a way to temporaly get the texture of a window 
without unminimising it.

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Compiz segfault

2007-01-10 Thread Bellegarde Cedric
since compiz  0.3.4; it segfault randomly at startup... 

So, sometime it works, sometime not :( No problem with 0.3.4.

Running gdb, i 've got this:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1221977856 (LWP 19014)]
0x08068fb8 in compSetStringOption (option=0x816ea60, value=0xbfca2888)
at option.c:154
154 if  (strcmp (option-rest.s.string[i], s) ==0)


David, if i can give you more information in any way, tell me ;)

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Compiz slower?

2007-01-03 Thread Bellegarde Cedric
I just updated compiz to current git.

Now, when moving windows, compiz  xorg eat 40% of cpu.

I switch back to my last git version (12/12/06) and eveything is working 
again...

i start the 12/12/06 version with: /usr/bin/compiz --use-cow --replace gconf

and the last git version with /usr/bin/compiz --replace gconf

Am i missing something?

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Compiz slower?

2007-01-03 Thread Bellegarde Cedric
Le mercredi 3 janvier 2007 23:58, vous avez écrit :
 try --loose-binding

Thanx, that's it!

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] No background with current git

2006-12-21 Thread Bellegarde Cedric
Since last git commit (disable default background), i can't set my background 
in Kde.

In fact, it doesn't work because show icons on desktop is disabled in my 
conf.

I tried with xsetroot, it doesn't work anymore too...

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Patch for place plugin (Cascade, Centered, ...)

2006-12-05 Thread Bellegarde Cedric
Here is a patch for place plugin.

It add a place_mode option wich actually can have two values: Cascade 
(original placement mode) and Centered.

Thanks for any comment!

Cedric
--- compiz_orig/plugins/place.c	2006-12-05 13:26:53.0 +0100
+++ compiz/plugins/place.c	2006-12-05 13:36:17.0 +0100
@@ -22,6 +22,7 @@
 
 #include math.h
 #include stdlib.h
+#include string.h
 
 #include compiz.h
 
@@ -29,6 +30,20 @@
 
 #define PLACE_WORKAROUND_DEFAULT TRUE
 
+typedef enum _PlaceMode
+{
+PlaceModeCascade,
+PlaceModeCentered,
+} PlaceMode;
+
+char *placeModes[] = {
+N_(Cascade),
+N_(Centered)
+};
+
+#define PLACE_MODE_DEFAULT PlaceModeCascade
+#define NUM_PLACE_MODES 2
+
 static int displayPrivateIndex;
 
 typedef struct _PlaceDisplay {
@@ -37,12 +52,14 @@
 } PlaceDisplay;
 
 #define PLACE_SCREEN_OPTION_WORKAROUND 0
-#define PLACE_SCREEN_OPTION_NUM1
+#define PLACE_SCREEN_OPTION_MODE   1
+#define PLACE_SCREEN_OPTION_NUM2
 
 typedef struct _PlaceScreen {
 CompOption opt[PLACE_SCREEN_OPTION_NUM];
 
 DamageWindowRectProc damageWindowRect;
+int placeMode;
 } PlaceScreen;
 
 #define GET_PLACE_DISPLAY(d)  \
@@ -87,6 +104,14 @@
 case PLACE_SCREEN_OPTION_WORKAROUND:
 	if (compSetBoolOption (o, value))
 	return TRUE;
+case PLACE_SCREEN_OPTION_MODE:
+if (compSetStringOption (o, value)) 
+	{
+int i;
+for (i = 0; i  o-rest.s.nString; i++)
+if (strcmp (placeModes[i], o-value.s) == 0)
+ps-placeMode = (PlaceMode) i;
+	}
 default:
 	break;
 }
@@ -105,6 +130,16 @@
 o-longDesc	 = N_(Window placement workarounds);
 o-type	 = CompOptionTypeBool;
 o-value.b	 = PLACE_WORKAROUND_DEFAULT;
+
+o = ps-opt[PLACE_SCREEN_OPTION_MODE];
+o-name = place_mode;
+o-shortDesc = N_(Place Mode);
+o-longDesc =
+N_(Select between Cascade or Centered placement);
+o-type = CompOptionTypeString;
+o-value.s = strdup (placeModes[PLACE_MODE_DEFAULT]);
+o-rest.s.string = placeModes;
+o-rest.s.nString = NUM_PLACE_MODES;
 }
 
 typedef enum {
@@ -554,7 +589,7 @@
 
 fluff = (work_area-width % (rect-width + 1)) / 2;
 rect-x = work_area-x + fluff;
-fluff = (work_area-height % (rect-height + 1)) / 3;
+fluff = (work_area-height % (rect-height + 1)) / 2;
 rect-y = work_area-y + fluff;
 }
 
@@ -692,6 +727,17 @@
 }
 
 static void
+placeCentered(CompWindow *window, 
+	  int *x, 
+	  int *y)
+{
+*x = window-screen-workArea.x 
+	+ (window-screen-workArea.width - get_window_width (window)) / 2;
+*y = window-screen-workArea.y 
++ (window-screen-workArea.height - get_window_height (window)) / 2;
+}
+
+static void
 placeWindow (CompWindow *window,
 	 intx,
 	 inty,
@@ -916,13 +962,17 @@
 x = x0;
 y = y0;
 
-if (find_first_fit (window, windows, x, y, x, y))
-	goto done_check_denied_focus;
-
-/* if the window wasn't placed at the origin of screen,
- * cascade it onto the current screen
- */
-find_next_cascade (window, windows, x, y, x, y);
+if (ps-placeMode == PlaceModeCascade)
+{
+if (find_first_fit (window, windows, x, y, x, y))
+	goto done_check_denied_focus;
+/* if the window wasn't placed at the origin of screen,
+ * cascade it onto the current screen
+ */
+ find_next_cascade (window, windows, x, y, x, y);
+}
+else /* Centered Mode */
+ placeCentered(window, x, y);
 
 /* Maximize windows if they are too big for their work area (bit of
  * a hack here). Assume undecorated windows probably don't intend to
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Patch for place plugin (Cascade, Centered, ...)

2006-12-05 Thread Bellegarde Cedric
Le mardi 5 décembre 2006 13:50, Bellegarde Cedric a écrit :
 Here is a patch for place plugin.

Sorry, first version wasn't good(stupid modification in Cascade mode), i'm a 
boulet (like we say in french).

So, here is good version...

Cedric
--- compiz_orig/plugins/place.c	2006-12-05 13:26:53.0 +0100
+++ compiz/plugins/place.c	2006-12-05 13:56:34.0 +0100
@@ -22,6 +22,7 @@
 
 #include math.h
 #include stdlib.h
+#include string.h
 
 #include compiz.h
 
@@ -29,6 +30,20 @@
 
 #define PLACE_WORKAROUND_DEFAULT TRUE
 
+typedef enum _PlaceMode
+{
+PlaceModeCascade,
+PlaceModeCentered,
+} PlaceMode;
+
+char *placeModes[] = {
+N_(Cascade),
+N_(Centered)
+};
+
+#define PLACE_MODE_DEFAULT PlaceModeCascade
+#define NUM_PLACE_MODES 2
+
 static int displayPrivateIndex;
 
 typedef struct _PlaceDisplay {
@@ -37,12 +52,14 @@
 } PlaceDisplay;
 
 #define PLACE_SCREEN_OPTION_WORKAROUND 0
-#define PLACE_SCREEN_OPTION_NUM1
+#define PLACE_SCREEN_OPTION_MODE   1
+#define PLACE_SCREEN_OPTION_NUM2
 
 typedef struct _PlaceScreen {
 CompOption opt[PLACE_SCREEN_OPTION_NUM];
 
 DamageWindowRectProc damageWindowRect;
+int placeMode;
 } PlaceScreen;
 
 #define GET_PLACE_DISPLAY(d)  \
@@ -87,6 +104,14 @@
 case PLACE_SCREEN_OPTION_WORKAROUND:
 	if (compSetBoolOption (o, value))
 	return TRUE;
+case PLACE_SCREEN_OPTION_MODE:
+if (compSetStringOption (o, value)) 
+	{
+int i;
+for (i = 0; i  o-rest.s.nString; i++)
+if (strcmp (placeModes[i], o-value.s) == 0)
+ps-placeMode = (PlaceMode) i;
+	}
 default:
 	break;
 }
@@ -105,6 +130,16 @@
 o-longDesc	 = N_(Window placement workarounds);
 o-type	 = CompOptionTypeBool;
 o-value.b	 = PLACE_WORKAROUND_DEFAULT;
+
+o = ps-opt[PLACE_SCREEN_OPTION_MODE];
+o-name = place_mode;
+o-shortDesc = N_(Place Mode);
+o-longDesc =
+N_(Select between Cascade or Centered placement);
+o-type = CompOptionTypeString;
+o-value.s = strdup (placeModes[PLACE_MODE_DEFAULT]);
+o-rest.s.string = placeModes;
+o-rest.s.nString = NUM_PLACE_MODES;
 }
 
 typedef enum {
@@ -692,6 +727,17 @@
 }
 
 static void
+placeCentered(CompWindow *window, 
+	  int *x, 
+	  int *y)
+{
+*x = window-screen-workArea.x 
+	+ (window-screen-workArea.width - get_window_width (window)) / 2;
+*y = window-screen-workArea.y 
++ (window-screen-workArea.height - get_window_height (window)) / 2;
+}
+
+static void
 placeWindow (CompWindow *window,
 	 intx,
 	 inty,
@@ -916,13 +962,17 @@
 x = x0;
 y = y0;
 
-if (find_first_fit (window, windows, x, y, x, y))
-	goto done_check_denied_focus;
-
-/* if the window wasn't placed at the origin of screen,
- * cascade it onto the current screen
- */
-find_next_cascade (window, windows, x, y, x, y);
+if (ps-placeMode == PlaceModeCascade)
+{
+if (find_first_fit (window, windows, x, y, x, y))
+	goto done_check_denied_focus;
+/* if the window wasn't placed at the origin of screen,
+ * cascade it onto the current screen
+ */
+ find_next_cascade (window, windows, x, y, x, y);
+}
+else /* Centered Mode */
+ placeCentered(window, x, y);
 
 /* Maximize windows if they are too big for their work area (bit of
  * a hack here). Assume undecorated windows probably don't intend to
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] Howto compile the kde decorator?

2006-11-10 Thread Bellegarde Cedric
Le vendredi 10 novembre 2006 17:50, Mike Dransfield a écrit :
 Maybe it is a simple fix, but its a bit beyond me.

compiz decorator and beryl decorator aren't compatible anymore :(

That's why there is heliodor ...
http://blog.beryl-project.org/?p=20

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


[compiz] Problem with scale plugin

2006-11-10 Thread Bellegarde Cedric
scale plugin set initiate_edge to TopRight sometime when i start compiz or 
when i make a change in scale plugin conf :(

My dirty fix was to set o-value.action.edgeMask to 0 for 
SCALE_DISPLAY_OPTION_INITIATE.

Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz


Re: [compiz] compiz plugins and window types

2006-11-10 Thread Bellegarde Cedric
Le vendredi 10 novembre 2006 18:22, vous avez écrit :
 I just pushed out some changes that should fix this problem. Let me know
 how it works.

Fixed ;)

Thanks,
Cedric
___
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz