New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mouse events and multiple documents #288
Comments
Off the top of my head, I feel like if they aren’t being processed and swallowed by the document, then they should pass to the next item in the Z-Order. Are you creating one large document for each RML that covers the whole view port, or are these documents never overlapping their outer bounds? Can you enable outlines in the debugger and send a screenshot of your layout? Based on what you’re saying, that doesn’t sound like the expected behavior but I want to make sure I understand the issue you’re having fully.
|
Hi @dwimsey , the setup is exactly as you describe: each of the separate RML doc is taking the whole viewport, but their contained widgets do not actually overlap. I'm attaching a few screenshots showing 2 documents: one for some object info (top of the viewport) and one with actions (bottom). Each of the doc has a body which covers the whole viewport (see the shots). I also would expect that the mouse events would traverse the different docs in their z order, I think the relevant code is here: object info shown as last, main div outlines object info shown as last, body outlines: actions widgets never receive mouse events actions doc shown as last: object info never gets the mouse events |
@dwimsey did you get a chance to riproduce the issue? |
@rickyviking how do you show the documents? Following test case:
When both are shown the hovering works. But when i click on the element with the text of the second document then the elements on the first document doesn't get any inputs anymore (even hover effects are not applied) |
@thewolfwillcome I have a demo application on which I can load several RML documents. Each document is loaded and then ElementDocument::Show() is called on it. |
@dwimsey @thewolfwillcome did you guys have the time to take a look to the code that should forward the events to the different docs? As I said before, the relevant bits should be in this method [UPDATE] <div id="view-list" class="view-list">
<div class="menu__item selected">Tab1</div>
<div class="menu__item">Tab2</div>
<div class="menu__item">Tab3</div>
<div class="view-list__controller">
<div class="view-list__control left-command">LB</div>
<div class="view-list__control right-command">RB</div>
</div>
</div> I'm able to hilight the outline only for the LB div element (first screenshot), if I try to pick any of the tab element (second screenshot), I get an hilight on the whole div which encloses the LB and RB elements. |
@rickyviking: That in your second example the elements in the div with class "view-list__controller" hides the other elements (With text Tab1-Tab3) is clear why. And this is the same behaviour as within an browser: <!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Titel</title>
<style>
div
{
display: block;
}
.menu__item
{
display: inline-block;
width: 50px;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
.menu__item:hover
{
background-color: red;
}
.left-command
{
float:left;
width: 50px;
border: 1px solid black;
}
.right-command
{
float:right;
width: 50px;
border: 1px solid black;
}
.view-list__controller
{
width: 350px;
height: 50px;
position: absolute;
top: 0;
left: -100px;
}
.test
{
position:relative;
margin-left: 100px;
}
</style>
</head>
<body>
<div class="test">
<div class="menu__item selected">Tab1</div>
<div class="menu__item">Tab2</div>
<div class="menu__item">Tab3</div>
<div class="view-list__controller">
<div class="view-list__control left-command">LB</div>
<div class="view-list__control right-command">RB</div>
</div>
</div>
</body>
</html> |
@dwimsey: Are you still there? The problem is really the method Context::GetElementAtPoint -> https://github.com/libRocket/libRocket/blob/master/Source/Core/Context.cpp#L1042 But if the method ignores element which are the owner document (aka the element with "body" as tag name) then both hover effects works. |
@thewolfwillcome thank you for the html example, I thought in the web browser it was working differently - then I'll have to sort this out in a different way. |
…(body) to allow lower indexed docs to receive events. This fixes issue libRocket#288. Might need more settings/flags to allow either the old and new behavior. Also factored out the recursive routine in a separate method to increase readability.
Hi all, |
Hi all,
in my application the GUI is split in several RML documents, each of them containing a logical part of the GUI and not overlapping with each other.
Now it may happen that several of these parts are shown simultaneously and should be all "responsive".
Visually the documents are shown correctly, but only the "latest" one (in showing order) receives mouse events, because the "body" element of the latest document hides the widgets belonging to other documents.
I'd like to receive the mouse events on all of my widget, disregarding the document they belong to.
Is there a way to get such behavior?
The text was updated successfully, but these errors were encountered: