Re: help!!!I got a trouble !about x11eventfilter!!
I destroy one window,just only one;but XSERVER will send five destroynotify to my client;why?
help me !thanks!!
here is my codes:
Code:
#if defined(Q_WS_X11)
{
display
=QX11Info::display();
// XOpenDisplay("0:0"); if (display == NULL)
{
printf("Cannot connect to X server " );
exit (-1);
};
XSelectInput
(display,
QX11Info::appRootWindow(QX11Info::appScreen()),SubstructureNotifyMask
);
}
bool App::x11EventFilter(XEvent *xe)
{
switch (xe->type)
{
case Expose:
return true;
case ConfigureNotify:
printf("resize1\n");
return true;
case DestroyNotify:
printf("destroy\n");
return true;
default:
return false;
}
}
#endif
Added after 4 minutes:
and another question,
when i use QApplication::x11eventfilter(),i find my appwindow cannot redraw itself if some other sub-window cover it,
Added after 13 minutes:
and
When I move my mouse to the GNOME's taskbar ,XSERVER will also create a destroy event ,even if no clicked
Added after 36 minutes:
can u understand what I wanna say?
my english is not very well for i am chinese;
Re: help!!!I got a trouble !about x11eventfilter!!
You might want to call the base class implementation instead of returning false. It doesn't astonish me that your widget is not redrawn if you are discarding all Expose events.
Re: help!!!I got a trouble !about x11eventfilter!!
thanks for your answer ,and,which function should I use to redrawn my widget?
e.x.
case expose:
widget.repaint();???
it seems doesn't work..
You might want to call the base class implementation instead of returning false??
can u give me some more details?
I dont know how to write if I call the base class implementation instead of returning false;
Re: help!!!I got a trouble !about x11eventfilter!!
Why do you want to do anything on Expose? Let Qt handle it. Just don't return true from the filter when you encounter the event.
Re: help!!!I got a trouble !about x11eventfilter!!
how to write if i dont return true?return false?
sorry, i just started to learn QT
Re: help!!!I got a trouble !about x11eventfilter!!
Why did you put "case Expose" in your filter? If you just started with Qt then messing with x11EventFilter is probably a very bad idea.
Re: help!!!I got a trouble !about x11eventfilter!!
but if I remove "case Expose",my wiget still can not redrawn itself
:(
and if I dont use the x11eventfilter function,i cant grab subwindow event;
Re: help!!!I got a trouble !about x11eventfilter!!
First of all call the base class implementation instead of returning false. And never return true unless you are sure this is what you want to do.
Re: help!!!I got a trouble !about x11eventfilter!!
thanks,I have solved this problem about redrawn,there is still some stuff make me crazy,but thanks for your help,i can move on