OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

CompositeViewer bug

Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Brad Huber
Guest





PostPosted: Mon May 02, 2011 9:25 pm    Post subject:
CompositeViewer bug
Reply with quote

I’ve attached a fix to a bug I discovered in CompositeViewer which allowed some GUI events to get sent to the wrong view. The attachment is duplicated in both .zip and .gz forms for convenience. This behavior was observed on a Windows machine and I did not test on any other OSes but I suspect it does exist on the other OSes as well.

I apologize if my submission is not quite in the right form. I tried to look online for a writeup about the submission protocol but the osg website was apparently down.

A description of the bug:
When using composite viewer, if getViewWithFocus() was NULL then masterView would get set to _views[0]. In the case where you resize the window frame (and you have not moused over any views within that window) then the resize event would mistakenly get sent to _views[0] which was in a different window altogether. I address this by setting masterView to the first view found within the graphics window instead.

PS I don’t know if this is the best/correct fix, or if something else should be done instead. It seems to fix the problem for me.

Thanks
-Brad

------------------
Post generated by Mail2Forum
Back to top
Brad Huber
Guest





PostPosted: Mon May 02, 2011 11:11 pm    Post subject:
CompositeViewer bug
Reply with quote

Actually the fix needs be more like what is attached. Please disregard the attachments to my first email about this same bug.

In addition to the bug description below, when a RESIZE event is received CompositeViewer currently does setCameraWithFocus(0); and does not change masterView (it should!!). This fix addresses that.

I look forward to hearing if there is a better fix for this issue…

Thanks
-Brad

From: [mailto:] On Behalf Of Brad Huber
Sent: Monday, May 02, 2011 3:24 PM
To:
Subject: CompositeViewer bug



I’ve attached a fix to a bug I discovered in CompositeViewer which allowed some GUI events to get sent to the wrong view. The attachment is duplicated in both .zip and .gz forms for convenience. This behavior was observed on a Windows machine and I did not test on any other OSes but I suspect it does exist on the other OSes as well.

I apologize if my submission is not quite in the right form. I tried to look online for a writeup about the submission protocol but the osg website was apparently down.

A description of the bug:
When using composite viewer, if getViewWithFocus() was NULL then masterView would get set to _views[0]. In the case where you resize the window frame (and you have not moused over any views within that window) then the resize event would mistakenly get sent to _views[0] which was in a different window altogether. I address this by setting masterView to the first view found within the graphics window instead.

PS I don’t know if this is the best/correct fix, or if something else should be done instead. It seems to fix the problem for me.

Thanks
-Brad

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Tue May 03, 2011 9:56 am    Post subject:
CompositeViewer bug
Reply with quote

Hi Brad,

I've reviewed your changes and they make me feel like I really need to
spend some time rethinking the management of the event focus. Neither
your changes or the original feel like clean solution.

Could you please outline how I can reproduce the bugs that you've seen
then I can think about these. I must admit I'm a bit cold on the
whole topic of CompositeViewer and event focus so will need a little
time to get back up to speed and make a good decision about how to go
forward - knowing how to recreate the problems will help ramp up
quicker.

Cheers,
Robert.

On Tue, May 3, 2011 at 12:06 AM, Brad Huber <> wrote:
Quote:
Actually the fix needs be more like what is attached.  Please disregard the
attachments to my first email about this same bug.



In addition to the bug description below, when a RESIZE event is received
CompositeViewer currently does setCameraWithFocus(0); and does not change
masterView (it should!!).  This fix addresses that.



I look forward to hearing if there is a better fix for this issue…



Thanks

-Brad



From:
[mailto:] On Behalf Of Brad
Huber
Sent: Monday, May 02, 2011 3:24 PM
To:
Subject: CompositeViewer bug



I’ve attached  a fix to a bug I discovered in CompositeViewer which allowed
some GUI events to get sent to the wrong view.  The attachment is duplicated
in both .zip and .gz forms for convenience.  This behavior was observed on a
Windows machine and I did not test on any other OSes but I suspect it does
exist on the other OSes as well.



I apologize if my submission is not quite in the right form.  I tried to
look online for a writeup about the submission protocol but the osg website
was apparently down.



A description of the bug:

When using composite viewer, if getViewWithFocus() was NULL then masterView
would get set to _views[0].  In the case where you resize the window frame
(and you have not moused over any views within that window) then the resize
event would mistakenly get sent to _views[0] which was in a different window
altogether.  I address this by setting masterView to the first view found
within the graphics window instead.



PS I don’t know if this is the best/correct fix, or if something else should
be done instead.  It seems to fix the problem for me.



Thanks

-Brad






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Brad Huber
Guest





PostPosted: Tue May 03, 2011 3:24 pm    Post subject:
CompositeViewer bug
Reply with quote

Robert,

I agree with you, event focus needs more scrutiny.

The easiest way to reproduce the bug that I was seeing regarding resize is
via the attached simple sample program. I've included the project, etc. for
Visual Studio but since there is only one source file you shouldn't have
much trouble compiling on Linux.

To produce the bug, click on the view in window one (that view receives
"focus") then resize the window frame of window two without mousing over the
view within window two. When you do the resize you should see the HUD in
view1/window1 resize (it shouldn't!!)

Thanks
-Brad

-----Original Message-----
From:
[mailto:] On Behalf Of
Robert Osfield
Sent: Tuesday, May 03, 2011 3:57 AM
To: OpenSceneGraph Submissions
Subject: Re: CompositeViewer bug

Hi Brad,

I've reviewed your changes and they make me feel like I really need to spend
some time rethinking the management of the event focus. Neither your
changes or the original feel like clean solution.

Could you please outline how I can reproduce the bugs that you've seen then
I can think about these. I must admit I'm a bit cold on the whole topic of
CompositeViewer and event focus so will need a little time to get back up to
speed and make a good decision about how to go forward - knowing how to
recreate the problems will help ramp up quicker.

Cheers,
Robert.

On Tue, May 3, 2011 at 12:06 AM, Brad Huber <> wrote:
Quote:
Actually the fix needs be more like what is attached.  Please
disregard the attachments to my first email about this same bug.



In addition to the bug description below, when a RESIZE event is
received CompositeViewer currently does setCameraWithFocus(0); and
does not change masterView (it should!!).  This fix addresses that.



I look forward to hearing if there is a better fix for this issue…



Thanks

-Brad



From:
[mailto:] On Behalf Of
Brad Huber
Sent: Monday, May 02, 2011 3:24 PM
To:
Subject: CompositeViewer bug



I’ve attached  a fix to a bug I discovered in CompositeViewer which
allowed some GUI events to get sent to the wrong view.  The attachment
is duplicated in both .zip and .gz forms for convenience.  This
behavior was observed on a Windows machine and I did not test on any
other OSes but I suspect it does exist on the other OSes as well.



I apologize if my submission is not quite in the right form.  I tried
to look online for a writeup about the submission protocol but the osg
website was apparently down.



A description of the bug:

When using composite viewer, if getViewWithFocus() was NULL then
masterView would get set to _views[0].  In the case where you resize
the window frame (and you have not moused over any views within that
window) then the resize event would mistakenly get sent to _views[0]
which was in a different window altogether.  I address this by setting
masterView to the first view found within the graphics window instead.



PS I don’t know if this is the best/correct fix, or if something else
should be done instead.  It seems to fix the problem for me.



Thanks

-Brad


graph.org



org



------------------
Post generated by Mail2Forum
Back to top
Meldryt
User


Joined: 02 Mar 2016
Posts: 54

PostPosted: Wed Jan 24, 2018 8:49 am    Post subject:
Reply with quote

Sry for digging up, but whats the current status of this bug?
I have migrated to 3.4.1 stable release and the problem still exits.

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Wed Jan 24, 2018 9:31 am    Post subject:
CompositeViewer bug
Reply with quote

On 24 January 2018 at 08:50, Sebastian Schmidt <> wrote:
Quote:
Sry for digging up, but whats the current status of this bug?
I have migrated to 3.4.1 stable release and the problem still exits.

Wow, that's an old thread to resurrect. There have quite a few
changes to the event handling since 3.0.x so it's frustrating that the
particular problem you are seeing hasn't be resolved with the other
improvements.

The only thing I can suggest is creating a test case that illustrates
the problem.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Alberto Luaces
Guest





PostPosted: Wed Jan 24, 2018 10:02 am    Post subject:
CompositeViewer bug
Reply with quote

"Sebastian Schmidt" writes:

Quote:
Sry for digging up, but whats the current status of this bug?
I have migrated to 3.4.1 stable release and the problem still exits.

------------------------
OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

Hi Sebastian,

can you try the unstable 3.5.9?

--
Alberto



------------------
Post generated by Mail2Forum
Back to top
Meldryt
User


Joined: 02 Mar 2016
Posts: 54

PostPosted: Wed Jan 24, 2018 3:52 pm    Post subject:
Re: CompositeViewer bug
Reply with quote

@Alberto Luaces

i will check that

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 54

PostPosted: Wed Jan 31, 2018 9:48 am    Post subject:
Reply with quote

Still not fixed with 3.5.9 Sad

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Wed Jan 31, 2018 3:46 pm    Post subject:
CompositeViewer bug
Reply with quote

On 31 January 2018 at 09:48, Sebastian Schmidt <> wrote:
Quote:
Still not fixed with 3.5.9 Sad

Could you create a small example that demonstrates the problem you
seeing. This will others to see the issue first hand and investigate
it fully.

Thanks,
Robert


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Meldryt
User


Joined: 02 Mar 2016
Posts: 54

PostPosted: Thu Feb 01, 2018 9:02 am    Post subject:
Reply with quote

I modified the osgwidgetcanvas example.
- a compositeviewer with two views
- each view has a window/canvas object
- put one window in foreground (the other should be maximized/bigger in background)
- try to resize the first window
-> both windows get the resize event
- if you don't see the bug, change focus, minimize/maximize again

_________________
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Fri Feb 02, 2018 9:36 am    Post subject:
CompositeViewer bug
Reply with quote

Thanks for the test program Sebastian. I don't have to time look into
it right away, but hope to get some time next week.

On 1 February 2018 at 09:02, Sebastian Schmidt <> wrote:
Quote:
I modified the osgwidgetcanvas example.
- a compositeviewer with two views
- each view has a window/canvas object
- put one window in foreground (the other should be maximized/bigger in background)
- try to resize the first window
-> both windows get the resize event
- if you don't see the bug, change focus, minimize/maximize again

------------------------
OSG Version: 3.4.1
OS: OpenSuse Leap 42.1

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72899#72899








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Thu Mar 08, 2018 10:55 am    Post subject:
CompositeViewer bug
Reply with quote

Hi Sebastian,

I have finally got time to look into this matter. I've compiled the
test case. Is there anything specific with osgWidget using a
osgWidget example that is important here?

Should I be expecting any console output or behaviour on screen that
illustrates the issues you are seeing?

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Thu Mar 08, 2018 2:37 pm    Post subject:
CompositeViewer bug
Reply with quote

Hi Sebastian,

To track what is happening with resize events I modified the test
example to include the following event callback:

class MyEventCakkback : public osgGA::GUIEventHandler
{
public:

std::string _message;

MyEventCakkback(const std::string& message):
_message(message)
{
}

virtual bool handle(const osgGA::GUIEventAdapter& ea,
osgGA::GUIActionAdapter& aa)
{
if (ea.getEventType()==osgGA::GUIEventAdapter::RESIZE)
{
OSG_NOTICE<<_message<<" :
ea.getEventType()==osgGA::GUIEventAdapter::RESIZE
("<<ea.getWindowX()<<", "<<ea.getWindowY()<<",
"<<ea.getWindowWidth()<<", "<<ea.getWindowHeight()<<")
gc="<<ea.getGraphicsContext()<<std::endl;
}
return false;
}
};

To callback is then added to the two views thus:


view->addEventHandler(new MyEventCakkback("View 1"));

wm->resizeAllWindows();

view->setSceneData(group);
viewer.addView(view);

osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
windows[0]->setWindowName("View 1");
}

.... code snipped....

view->addEventHandler(new MyEventCakkback("View 2"));

wm->resizeAllWindows();

view->setSceneData(group);
viewer.addView(view);

osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
windows[1]->setWindowName("View 2");

}

I have resizing in various combinations and mostly the callbacks all
report the correct View, settings and graphics context, but
occasionally it looks like resizes to one window/view get assigned to
the other view.

What it looks like to me is that if I move the mouse over the 3d
viewport in any way that window correctly gets "focus" and then any
resizes to that window work correctly. If I then move the move to
resize the other window without the mouse ever going over the 3d
viewport of that second window then "focus" is left with the original
window and results in the events still going to the original window.

I don't know the cause of this bug yet, but at least I have concrete
way of reproducing it. I am testing under Kubuntu 16.04, so have
KDE/X11 windowing system running. It may be helpful to find out if
this same issue occurs on other desktops.

I have attached the modified test program and CMakeLists.txt to build it.

Robert.



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11622

PostPosted: Thu Mar 08, 2018 4:38 pm    Post subject:
CompositeViewer bug
Reply with quote

I have spent time looking into how the
CompositeViewer::eventTraversal() handles event focus and different
types of events and decided the best way to improve the event handling
behaviour is to treat different classes of events in different ways,
the enum I've used to should hopefully be self explanatory:

enum EventClassification
{
EVENT_FOR_VIEW_ASSOCIATED_WITH_FOCUS,
EVENT_FOR_VIEWS_ASSOCIATED_WITH_WINDOW,
EVENT_FOR_ALL_VIEWS
};

This EvenClassification is then made for each event, so things like
RESIZE and CLOSE_WINDOW got to EVENT_FOR_VIEWS_ASSOCIATED_WITH_WINDOW,
while QUIT and USER go to EVENT_FOR_ALL_VIEWS and finally all the rest
of the events get assigned EVENT_FOR_VIEW_ASSOCIATED_WITH_FOCUS. Code
then send the event to one of more views depending upon this
classification. The new code is checked in to OSG master:

https://github.com/openscenegraph/OpenSceneGraph/commit/e17f1c4e317a23dca5e36959c9a1059dab6dd733

With this set of changes the osgWidget test program in this thread now
works as expected whether moving the mouse directly to the title bar
to resize without gaining focus, and with doing the same with getting
focus by moving the mouse over the 3d region of the window.

I welcome testing out in the community of these changes. If things
all look good I'll look into merging these improvements to the OSG-3.4
and OSG-3.2 branches.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts CompositeViewer Bug with Scroll Events Daniel Emminizer, Code... General 1 Tue Apr 03, 2018 3:21 pm View latest post
No new posts raise windows in compositeviewer Meldryt General 0 Mon Jan 08, 2018 2:56 pm View latest post
No new posts CompositeViewer:: checkNeedToDoFrame(... makulis General 3 Sun Sep 24, 2017 9:26 pm View latest post
No new posts compositeviewer, close and remove view Meldryt General 0 Wed Dec 14, 2016 2:01 pm View latest post
No new posts CompositeViewer and FBO minghia General 1 Tue Jul 26, 2016 3:43 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP