Xpra: Ticket #2269: HTML5 Improvements

I've been working on improving the HTML5 client for our own needs, namely:

It's functional but rough around the edges. Not sure if you're interested in taking it on? I can tidy it up a bit more if you are.

There's a lot of file changes here so I'd recommend copying from head at: https://github.com/mjharkin/Xpra/tree/dev



Wed, 10 Apr 2019 10:43:29 GMT - Mark Harkin: attachment set

Floating Menu


Wed, 10 Apr 2019 10:43:40 GMT - Mark Harkin: attachment set

open windows menu


Wed, 10 Apr 2019 10:55:33 GMT - Antoine Martin: owner changed

I would totally take all of the above if you can submit it. It might be a lot easier to merge before the refactoring and move to typescript.


Wed, 10 Apr 2019 11:45:40 GMT - Mark Harkin:

Great, I'll tidy up and make a few more changes and hopefully submit a patch sometime next week.

Do you want to keep the top bar as an option alongside these changes or can I replace it?


Wed, 10 Apr 2019 11:47:21 GMT - Antoine Martin:

Great, I'll tidy up and make a few more changes and hopefully submit a patch sometime next week.

Excellent, thanks!

Do you want to keep the top bar as an option alongside these changes or can I replace it?

I'm not sure yet. I was thinking of adding a few more items in the top bar, but maybe this won't be needed. Sorry, I don't know at this point.


Wed, 10 Apr 2019 12:53:50 GMT - Mark Harkin:

Do you want to keep the top bar as an option alongside these changes or can I replace it?

I'm not sure yet. I was thinking of adding a few more items in the top bar, but maybe this won't be needed. Sorry, I don't know at this point.

No problem, I'll keep them both as mutex options.


Tue, 16 Apr 2019 14:00:50 GMT - Mark Harkin: attachment set


Tue, 16 Apr 2019 14:10:31 GMT - Mark Harkin: owner changed

There quite a lot here, I'm hoping you'll accept it all. The git diff is at https://github.com/mjharkin/Xpra/commit/7d5a4f0e3a84cc007f831480bfcc7934401625b7 I'll try and list the changes:

float menu bar:

I think the easiest way to submit this was zipping the html5 folder (html5_pr.zip​). the code was branched from r22434


Tue, 16 Apr 2019 19:54:07 GMT - Mark Harkin:

Sorry, already one quick patch needed on top of the zip, forgot to test taskbar mouse actions.

https://github.com/mjharkin/Xpra/commit/0dcea2f807c86abe03c7bb55a9627e1d833acf4e


Wed, 17 Apr 2019 11:13:14 GMT - Antoine Martin: owner changed

I've started merging some of this stuff (ignoring quite a bit of whitespace or line swaps helped):

I haven't merged the submit-on-enter-in-password field because, that already works in 2.5

As for the rest, something isn't working. Can you rebase and submit more piecemeal patches? Splitting up the different changes, ie:


Wed, 17 Apr 2019 11:49:37 GMT - Mark Harkin:

Replying to Antoine Martin:

I've started merging some of this stuff (ignoring quite a bit of whitespace or line swaps helped):

That's weird, I thought I cleaned up any whitespace at least in the git diff, submitted from a Linux box so maybe it's a line endings issue.

Yeah think this was an IE issue

I haven't merged the submit-on-enter-in-password field because, that already works in 2.5

As for the rest, something isn't working.

Strange, definitely working on head at​https://github.com/mjharkin/Xpra/tree/dev

Can you rebase and submit more piecemeal patches? Splitting up the different changes, ie:

Yeah I'll split it up as best i can and resubmit, probably towards the end of next week due to other commitments.


Thu, 18 Apr 2019 06:40:07 GMT - Mark Harkin: attachment set

small patches


Thu, 18 Apr 2019 06:45:58 GMT - Mark Harkin:

@Antoine Martin Can you try these patches (attached) for the small stuff and then I'll rebase again for the floating menu changes. Patches are from git so hopefully they should work. 1 New window theme 2 Jide popup fixes 3 Fix for no mouse events on windows that aren't in focus 4 Force current window focus on server 5 Increase hello timeout as this happens alot with proxy server 6 Danish language fixes (double entry in keycodes not sure how to properly handle this) 7 Catch incorrect window resize event


Thu, 18 Apr 2019 08:36:42 GMT - Antoine Martin:

Updates:

PS: your patches were in UTF-16LE, not the easiest format to deal with. I've converted them using:

iconv -f UTF-16LE -t UTF-8 2.patch > 2-utf8.patch

Thu, 18 Apr 2019 09:00:18 GMT - Mark Harkin:

Replying to Antoine Martin:

Updates:

Great, thanks.

I'll try and get something togther next week

Sorry didn't realize mouse events are allowed on unfocused windows. I'll try and get something that's specific to window titlebars for next week

It's a java windows that is shown, removed and shown again very quickly. I'll try and get a test case together for it.

Probably not but my proxy spawned servers take quite a while, 30secs would probably be ok.

Thanks. Any idea on the other part of it? I just want Oslash but Ooblique is being sent. I just reordered to send Oslash instead.

PS: your patches were in UTF-16LE, not the easiest format to deal with. I've converted them using:

iconv -f UTF-16LE -t UTF-8 2.patch > 2-utf8.patch

I'll try and diff as UTF-8 or convert before uploading next time


Thu, 18 Apr 2019 09:16:48 GMT - Antoine Martin:

Sorry didn't realize mouse events are allowed on unfocused windows.

Try r22463. It should be better already.

.. 30secs would probably be ok.

Reduced to 30s in r22464.

Any idea on the other part of it?

Oh right, forgot about that one. Done: r22465. (I wished there was a better way... keyboard mapping is always hit or miss, mostly miss)


Thu, 25 Apr 2019 08:33:05 GMT - Mark Harkin: attachment set


Thu, 25 Apr 2019 08:42:41 GMT - Mark Harkin:

@Antoine Martin Can you try and overlay float_menu_changes.zip on the html5 folder. (Don't think I can create a patch with binary files)

This is rebased from r22546 and should contain "the rest", float menu, start menu and minimize. excluding the patches previously submitted. Github diff is here: https://github.com/mjharkin/Xpra/commit/5b8faf48dbe13c0967ceec205ebf7558e792b461


Thu, 25 Apr 2019 15:38:51 GMT - Antoine Martin: attachment set

work in progress patch


Thu, 25 Apr 2019 15:39:34 GMT - Antoine Martin: owner, status changed

I like this a lot, it works beautifully so I think I will drop the top bar.

Some questions / notes:

Here's an updated work in progress patch with:


Thu, 25 Apr 2019 18:09:52 GMT - Mark Harkin:

These changes are relatively small so just to be quick I'll point you to the github diffs:

Replying to Antoine Martin:

I like this a lot, it works beautifully so I think I will drop the top bar.

Great, yeah I don't think the top bar is needed after this.

Damn, was a little eager with the clean up, fix is here: https://github.com/mjharkin/Xpra/commit/6c5517db362b333af5ffe91ad5821dedd1909cf5

Increased to 20px and a little rework here: https://github.com/mjharkin/Xpra/commit/fe6b046ae912081a7e4d3e1d109aa2c2842475fc

Constrained here: https://github.com/mjharkin/Xpra/commit/ccc8037abc1a0226e210ab6ffdb40fb53394a561

Agreed, a super grandparent!, changed here: https://github.com/mjharkin/Xpra/commit/ae69e1f5bff7069baf3b615974e6012472d0f3c0


Mon, 29 Apr 2019 05:17:00 GMT - Antoine Martin:

Updates:

Things left to fix:


Mon, 29 Apr 2019 05:25:32 GMT - Antoine Martin:

With r22556, the tray shows up again, but clicking on it doesn't do anything. And when "autohide" is enabled, the tray icon cannot be clicked on as the line wraps outside the floating menu.

r22557 fixes fullscreeen (was using the top-bar element, now removed).


Tue, 30 Apr 2019 08:23:37 GMT - Antoine Martin:

The tray location was not getting synced, fixed in r22558. They needed a little bit more space to prevent wrapping: r22559. (I profoundly dislike adding hard-coded values like this.. but couldn't find a better fix)


Tue, 30 Apr 2019 09:47:08 GMT - Mark Harkin:

@Antoine

I tried to do some testing on this but it looks like the tray is broken server side in the latest centos beta and possibly also head.

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/x11/gtk_x11/tray.py", line 202, in do_xpra_client_message_event
    window = x11_foreign_new(xid)
  File "/usr/lib64/python2.7/site-packages/xpra/gtk_common/gtk_util.py", line 484, in x11_foreign_new
    return gdk.window_foreign_new_for_display(xid)
TypeError: window_foreign_new_for_display() argument 1 must be gtk.gdk.Display, not int

Tue, 30 Apr 2019 09:56:20 GMT - Antoine Martin:

TypeError: window_foreign_new_for_display() argument 1 must be gtk.gdk.Display, not int

Oops, sorry, try r22567.


Thu, 02 May 2019 07:21:46 GMT - Mark Harkin:

Tray and autohide are still a bit messy I'll come back to this, but here's a potential fix for mouse events on underlying windows: https://github.com/mjharkin/Xpra/commit/400348d232cc519bb08101b7f6fdb6b0198a083e


Thu, 02 May 2019 08:35:06 GMT - Antoine Martin:

here's a potential fix for mouse events on underlying windows:

Hmm, wouldn't that prevent ALL motion events from being reported against the root? Some applications (ie: xeyes) want to track the pointer even when it isn't confined to their own window.


Thu, 02 May 2019 11:06:51 GMT - Mark Harkin:

Replying to Antoine Martin:

here's a potential fix for mouse events on underlying windows:

Hmm, wouldn't that prevent ALL motion events from being reported against the root? Some applications (ie: xeyes) want to track the pointer even when it isn't confined to their own window.

Yeah fair enough, I'm sure there's a better way of doing this and I'm just hacking now but something like this would be close but would need somthing similar for titlebar buttons.

	var targetId = e.target.id;
	if(targetId.startsWith("head")){
		wid = targetId.replace("head", '');
	}else if(targetId.startsWith("title")){
		wid = targetId.replace("title", '');
	}else if(targetId.startsWith("windowicon")){
		wid = targetId.replace("windowicon", '');
	}else if(targetId!="screen" && e.target.localName != "canvas"){
		return;
	}

I'm trying to stop the mouse events hitting the window under another windows titlebar, so I guess the events should be send to the window of that titlebar instead... and then of course avoid window events when using the float menu.


Mon, 03 Jun 2019 11:06:15 GMT - Antoine Martin:

See also #2292, #2312, #1844.


Thu, 25 Jul 2019 13:23:21 GMT - Antoine Martin: status changed; resolution set

The help I was hoping to get did not materialize, so I don't have time to take this further... sorry. This will have to do for 3.0, will follow up in #2369


Fri, 13 Sep 2019 18:04:45 GMT - Andras Sali:

We also ran into the titlebar "click through" issue. A workaround we are using is to add the following in Window.js at the end when the window is created (right after the " assign some interesting callbacks" comment):

jQuery(this.div).mousedown(function (e) {
			e.stopPropagation();
		})

This solves the issue as the "ghost click" is created from the titlebar click propagating up the parent to "#screen" where an event listener sends it to the server. Using the above the event is not propagated from the window to the screen div and there are no "phantom clicks". Clicks landing outside the div are not affected. Clicks inside the div are not affected.


Sat, 14 Sep 2019 03:48:07 GMT - Antoine Martin:

This solves the issue as the "ghost click" is created from the titlebar click propagating up the parent to "#screen" where an event listener sends it to the server.

Awesome, thank you! Applied in r23788 with one minor change: this change stops both mousedown and mouseup from propagating, the vast majority of applications won't handle mouseup if they don't first see a mousedown, but some do.


Fri, 20 Sep 2019 00:47:40 GMT - Antoine Martin:

Applied in r23788 with one minor change: this change stops both mousedown and mouseup from propagating, the vast majority of applications won't handle mouseup if they don't first see a mousedown, but some do.

The minor change caused a bug: #2418, so that part got reverted in r23826.


Sat, 23 Jan 2021 05:46:41 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2269