Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » Compiz fix
Compiz fix [message #20820] Fri, 10 April 2009 17:32 Go to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I don't know how the standard settings are in other Linux distributions but at least in Ubuntu the standard settings for compiz is to use the Animation plugin, an they have different animations for top level windows and "other" windows (like popupmenus and other things). So for example if you open the file menu in TheIDE it looks weird. Compiz decides what animation it should use according to its type.

I have hacked a quick fix which works for me, but it isn't really nice, because I just set every window which is created with redirect==true to be a popup menu. I'm afraid I don't know how I could detect in the Create method which sort of window actually is created and set type correctly.

EDIT: The patch is for the CtrlCore/X11Wnd.cpp file Wink
EDIT2: And a link which shows every type a WM should understand: http://standards.freedesktop.org/wm-spec/1.4/ar01s05.html
A correct fix would probably use those types.
  • Attachment: patch
    (Size: 0.54KB, Downloaded 415 times)

[Updated on: Fri, 10 April 2009 17:35]

Report message to a moderator

Re: Compiz fix [message #20855 is a reply to message #20820] Tue, 14 April 2009 19:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Fri, 10 April 2009 11:32

Hi,

I don't know how the standard settings are in other Linux distributions but at least in Ubuntu the standard settings for compiz is to use the Animation plugin, an they have different animations for top level windows and "other" windows (like popupmenus and other things). So for example if you open the file menu in TheIDE it looks weird. Compiz decides what animation it should use according to its type.

I have hacked a quick fix which works for me, but it isn't really nice, because I just set every window which is created with redirect==true to be a popup menu. I'm afraid I don't know how I could detect in the Create method which sort of window actually is created and set type correctly.

EDIT: The patch is for the CtrlCore/X11Wnd.cpp file Wink
EDIT2: And a link which shows every type a WM should understand: http://standards.freedesktop.org/wm-spec/1.4/ar01s05.html
A correct fix would probably use those types.


Thanks, applied.

I guess that for really good fix, we will have to add "type hint" to Ctrl (MENU, TOOLTIP, DROPLIST etc...) and call it appropriately... (with some reasonable default).

Mirek
Re: Compiz fix [message #20944 is a reply to message #20820] Mon, 20 April 2009 15:20 Go to previous messageGo to next message
phirox is currently offline  phirox
Messages: 49
Registered: December 2007
Member
Also related to compiz. With the latest svn version I have this bug that characters I type sometimes get multiplied. "LLikke thisss when youu ttype".

I was wondering if anyone else noticed this.

I'll check tonight if it is a specific compiz module that causes this, and if I can find out which reversion it started occuring.
Re: Compiz fix [message #20993 is a reply to message #20944] Fri, 24 April 2009 10:42 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
phirox wrote on Mon, 20 April 2009 09:20

Also related to compiz. With the latest svn version I have this bug that characters I type sometimes get multiplied. "LLikke thisss when youu ttype".

I was wondering if anyone else noticed this.

I'll check tonight if it is a specific compiz module that causes this, and if I can find out which reversion it started occuring.



R807 there was accepted related submitted patch...

The file is CtrlCore/X11Proc.cpp.

(Use svn history in theide).

Mirek
Re: Compiz fix [message #20999 is a reply to message #20993] Fri, 24 April 2009 20:07 Go to previous messageGo to next message
phirox is currently offline  phirox
Messages: 49
Registered: December 2007
Member
luzr wrote on Fri, 24 April 2009 10:42


R807 there was accepted related submitted patch...

The file is CtrlCore/X11Proc.cpp.

(Use svn history in theide).

Mirek


Thanks for pointing me in the right direction. My problem was fixed by removing the newly added code. Basically the following code has been put around the ev1 part:
	if(ev1->type == KeyPress)
		*ev2 = *ev1;
	else {
		...
	}

My guess is that it is an attempt at speeding up things but somehow the IsWaitingEvent() call is too important to skip.
Re: Compiz fix [message #21004 is a reply to message #20999] Sat, 25 April 2009 10:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
phirox wrote on Fri, 24 April 2009 14:07

luzr wrote on Fri, 24 April 2009 10:42


R807 there was accepted related submitted patch...

The file is CtrlCore/X11Proc.cpp.

(Use svn history in theide).

Mirek


Thanks for pointing me in the right direction. My problem was fixed by removing the newly added code. Basically the following code has been put around the ev1 part:
	if(ev1->type == KeyPress)
		*ev2 = *ev1;
	else {
		...
	}

My guess is that it is an attempt at speeding up things but somehow the IsWaitingEvent() call is too important to skip.



Well, in fact, now I remember, it was not accepted patch, but my fix.

I believe the problem to fix is that some X11 systems, in case of autorepeat, put series of "KeyPress/KeyRelease" pairs, while others (and especially those with compiz enabled) only series of KeyPress.

I would like to find a reason for doubling characters before reversing the change. Maybe you could activate LLOGs (at the beginning of file) to see what is going on?

Mirek
Re: Compiz fix [message #21005 is a reply to message #20820] Sat, 25 April 2009 11:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, thinking about the issue, maybe this patch might help:

	case KeyPress:
		pressed = true;
		LLOG("event type:" << event->type << " state:" << event->xkey.state <<
		     "keycode:" << event->xkey.keycode);
		for(;;) {
			XEvent ev1[1], ev2[1];
			bool hasev2 = false;
			if(!IsWaitingEvent()) break;
			do
				XNextEvent(Xdisplay, ev1);
			while(ev1->type == NoExpose && IsWaitingEvent());
			LLOG("ev1 type:" << ev1->type << " state:" << ev1->xkey.state <<
			     "keycode:" << ev1->xkey.keycode);
			if(ev1->type == KeyPress)
				*ev2 = *ev1;
			else {
				if(ev1->type != KeyRelease ||
				   ev1->xkey.state != event->xkey.state ||
				   ev1->xkey.keycode != event->xkey.keycode ||
				   !IsWaitingEvent()) {
				   	XPutBackEvent(Xdisplay, ev1);
				   	break;
				}
				do
					XNextEvent(Xdisplay, ev2);
				while(ev2->type == NoExpose && IsWaitingEvent());
				LLOG("ev2 type:" << ev2->type << " state:" << ev2->xkey.state <<
				     "keycode:" << ev2->xkey.keycode);
				hasev2 = true;
			}
			if(ev2->type != KeyPress ||
			   ev2->xkey.state != event->xkey.state ||
			   ev2->xkey.keycode != event->xkey.keycode) {
				if(hasev2)
					XPutBackEvent(Xdisplay, ev2);
				XPutBackEvent(Xdisplay, ev1);
				break;
			}
			else {
				XFilterEvent(ev1, None);
				if(hasev2)
					XFilterEvent(ev2, None);
			}
			count++;
		}
	case KeyRelease: {


Please try. (It is on svn too).

Mirek
icon14.gif  Re: Compiz fix [message #21006 is a reply to message #21005] Sat, 25 April 2009 12:40 Go to previous messageGo to next message
phirox is currently offline  phirox
Messages: 49
Registered: December 2007
Member
Ok, I tried the one from the svn. And it works great! Actually a bit faster then before, because I don't see any weird delays occurring anymore while typing.

FYI here is an excerpt from the log where I typed some strings and undid them:
12:36:29   KEYUP Space
12:36:29   CHAR 'f' (102)
12:36:29   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:29   CHAR 'a' (97)
12:36:29   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:29   CHAR 's' (115)
12:36:29   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:30   CHAR 't' (116)
12:36:30   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:30   CHAR '.' (46)
12:36:30   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:30 KEY Shift
12:36:30   CHAR '"' (34)
12:36:34 KEY Ctrl
12:36:34 KEY Ctrl+Z
12:36:34   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:34   KEYUP Ctrl+Z
12:36:34 KEY Ctrl+Z
12:36:34   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:35 KEY Ctrl+Z
12:36:35   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:35 KEY Ctrl+Z
12:36:35   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:35   KEYUP Ctrl+Z
12:36:36   KEYUP Ctrl
12:36:36   -> 3Ide "ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }"
12:36:36 KEY Ctrl
12:36:36 KEY Ctrl+Z
12:36:36   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8 *] { uppsvn }")
12:36:37   KEYUP Ctrl+Z
12:36:37 KEY Ctrl+Z
12:36:37   -> 12AssistEditor ("ide - GUI - TheIDE - [/home/phirox/uppsvn/uppsrc/CtrlCore/X11Proc.cpp UTF-8] { uppsvn }")
12:36:37   KEYUP Ctrl+Z
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37 KEY Ctrl+Z
12:36:37   HOT-> N3Upp14TopSubMenuItemE : 0xb5570b18(parent N3Upp7BarPaneE)
12:36:37   KEYUP Ctrl+Z
12:36:37   KEYUP Ctrl

Re: Compiz fix [message #21007 is a reply to message #21006] Sat, 25 April 2009 13:15 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
phirox wrote on Sat, 25 April 2009 06:40

Ok, I tried the one from the svn. And it works great! Actually a bit faster then before, because I don't see any weird delays occurring anymore while typing.



That is good news, thanks for reporting.

Mirek
Previous Topic: Questions about themeing plz
Next Topic: ChGtk menu fix
Goto Forum:
  


Current Time: Thu Mar 28 18:50:53 CET 2024

Total time taken to generate the page: 0.01254 seconds