Commit Graph

512 Commits

Author SHA1 Message Date
Alexander Larsson
c839f2910c [broadway] Store surface, not id in stackingOrder list 2011-04-11 12:09:43 +02:00
Alexander Larsson
ace1c4c284 [broadway] Set transient-for before showing window
When syncing windows, make sure we set transient-for before showing
the window to avoid it being visible with the wrong transient-for
(i.e. possibly on the wrong browser window).
2011-04-11 12:09:43 +02:00
Alexander Larsson
05dfb7f594 [broadway] Fix css typo
rgb takes 3 params, rgba takes four.
2011-04-11 12:09:43 +02:00
Alexander Larsson
7a197e5b65 [broadway] Fix up frame size calculation
Turns out that offsetTop/Left doesn't contain the border, so we need
to manually add that in.
2011-04-11 12:09:43 +02:00
Alexander Larsson
2728cc9508 [broadway] Remove expensive transparency effects from css 2011-04-10 21:10:07 +02:00
Alexander Larsson
d6beabbff2 [broadway] Make the toplevel mode a url parameter 2011-04-10 20:16:13 +02:00
Alexander Larsson
fe79bbd618 [broadway] Position non-popup windows ourselves
We ignore the initial positions for non-popup windows, instead we
place the windows ourselves (or in the useToplevel mode by the WM).
2011-04-10 20:16:13 +02:00
Alexander Larsson
e5d8905cd2 [broadway] Fix up toplevel content visibility in useToplevel mode
surfaces.canvas may change if we move to another document, so
reupdate the element to show after ensureSurfaceInDocument.
2011-04-10 20:16:13 +02:00
Alexander Larsson
fadaced85f [broadway] Move window to top when moving 2011-04-10 20:16:13 +02:00
Alexander Larsson
618dc872b0 [broadway] Add some initial work for in-window frames
The css is based on work by Jasper St Pierre:
http://magcius.mecheye.net/vista/
2011-04-10 20:16:13 +02:00
Alexander Larsson
69eafcc3c5 [broadway] Fix some typos in the js code 2011-04-10 20:16:13 +02:00
Alexander Larsson
930e43c710 [broadway] Use the right doctype for html5 2011-04-10 20:16:13 +02:00
Alexander Larsson
955f01cdf7 [broadway] Enable useToplevelWindow by default for now 2011-04-07 21:16:52 +02:00
Alexander Larsson
7128087cb4 [broadway] Implement selections 2011-04-07 20:21:22 +02:00
Alexander Larsson
cad40b24e2 [broadway] Remove unused hashtables 2011-04-07 20:20:51 +02:00
Alexander Larsson
d12a9a5e99 [broadway] Add gdk_broadway_display_get_last_seen_time 2011-04-07 20:18:13 +02:00
Alexander Larsson
42cbed6759 [broadway] Fix up header guards to not refer to gdkx.h 2011-04-07 20:04:48 +02:00
Alexander Larsson
f0e1115f80 [broadway] Add gdkbroadway.h public header 2011-04-07 19:25:16 +02:00
Alexander Larsson
095ccf9c11 [broadway] Serialize event times
Event times come from the browser and may change weirdly when we reconnect
with another browser, so we normalize these to be strictly increasing
and with a 5 second gap for each reconnect.
2011-04-07 19:12:51 +02:00
Alexander Larsson
9d974ca13a [broadway] Fix typo in implicit grab support
We do an implicit grab if there is no grab already, not only if there is
one.
2011-04-07 15:26:37 +02:00
Alexander Larsson
dd07f534f4 [broadway] Handle screen size
Without this menu placement doesn't work right
2011-04-07 15:10:39 +02:00
Alexander Larsson
8c20b476df [broadway] Track and report last and future state
This fixes the drawing area demo in gtk-demo
2011-04-07 14:36:30 +02:00
Alexander Larsson
1a7b76d49d [broadway] Report mouse pointer coordinates right
The windows argument to device_query_state can be a client side
window, but we must only handle the "native" part of it (i.e.
window->impl->wrapper).
2011-04-07 14:29:26 +02:00
Alexander Larsson
43aac66458 [broadway] Fix all unnecessary warnings 2011-04-07 10:03:17 +02:00
Alexander Larsson
3b1fe05e78 [broadway] Wire up the delete event 2011-04-07 10:03:17 +02:00
Alexander Larsson
06fc6e007e [broadway] Report right root coors in toplevel mode 2011-04-07 10:03:17 +02:00
Alexander Larsson
adc05ae6b7 [broadway] Add configure event for browser-side geometry changes
Atm this only works for the useToplevelWindows case, but we can add
a browser wm to make use of it inside the browser too.
2011-04-07 10:03:17 +02:00
Alexander Larsson
1365e93fad [broadway] Add experimental toplevel window mode
This mode makes each toplevel window get its own browser window, with
popup windows using the browser window of their transient parent.

Its not idea, as you can't get rid of all browser chrome by default, and
it means popups (like menus) can't extend outside the toplevels. But, it is
kinda cool.
2011-04-07 10:03:17 +02:00
Alexander Larsson
8831efa735 [broadway] Fixup ungrab reference to old time variable 2011-04-07 10:03:17 +02:00
Alexander Larsson
05bda376f6 [broadway] Break out document setup into its own function
In the future we might have more documents (one per toplevel browser
window).
2011-04-07 10:03:17 +02:00
Alexander Larsson
06ad0f52e2 [broadway] Remove unused grab.time on browser side 2011-04-07 10:03:17 +02:00
Alexander Larsson
f53771cc1d [broadway] Break out all command handling to separate functions
We don't want to mix up the argument parsing with the actual implementation.
2011-04-07 10:03:17 +02:00
Alexander Larsson
7c20d59411 [broadway] Make the surface object a plain js object, not the context 2011-04-07 10:03:17 +02:00
Alexander Larsson
9f848aaf30 [broadway] Centralize surface creation code in js 2011-04-07 10:03:17 +02:00
Alexander Larsson
199cd1548f [broadway] Track window type in browser 2011-04-07 10:03:17 +02:00
Alexander Larsson
9c5c4223e3 [broadway] Track transient_for 2011-04-07 10:03:17 +02:00
Alexander Larsson
e1dcd6735e [broadway] Remove unused query pointer message 2011-04-07 10:03:16 +02:00
Alexander Larsson
5b645357d6 [broadway] Don't roundtrip for getting current pointer location
Roundtrips are bad, and this gets called a lot, so we use all currently
availible future info to "emulate" a full roundtrip, but with much lower
cost.
2011-04-07 10:03:16 +02:00
Alexander Larsson
a0048d5e70 [broadway] Add _gdk_broadway_display_consume_all_input
This parses and queues all currently availible input data non-blockingly.
Useful to ensure the latest up-to-date future info.
2011-04-07 10:03:16 +02:00
Alexander Larsson
fdc2059edb [broadway] Track future pointer events locations during parsing
We want this info so that we can avoid roundtrips and still get
a somewhat better querying for pointer locations.
2011-04-07 10:03:16 +02:00
Alexander Larsson
1fa952fb04 [broadway] Add helper for processing input at idle 2011-04-07 10:03:16 +02:00
Alexander Larsson
e113cf26fb [broadway] Keep track of current real cursor window (sans grabs)
We need this to be able to do a non-roundtripping get-window.
2011-04-07 10:03:16 +02:00
Alexander Larsson
ee1657d88e [broadway] Break out _gdk_broadway_display_read_all_input_nonblocking
This is useful in other places, like when we want to iterate over
all messages recieved so far.
2011-04-07 10:03:16 +02:00
Alexander Larsson
d664e78c94 [broadway] Make pointer grabs not roundtrip
Since we're really only initializing grabs (except for implicit
grabs at least) from the client side we might as well do all the grab
time checks on the client side to avoid unnecassary roundtrips.
2011-04-07 10:03:16 +02:00
Alexander Larsson
56d05e093d [broadway] Save last event time seen 2011-04-07 10:03:16 +02:00
Alexander Larsson
8aad17592e [broadway] Parse broadway input messages earlier
We now parse the broadway messages as soon as they are read from the wire.
This will let us sanely do lookahead in the message queue later.
2011-04-07 10:03:15 +02:00
Cosimo Cecchi
69b9794d9e broadway: fix a build warning 2011-03-16 10:48:24 -04:00
Alexander Larsson
9a26fd25af broadway: Enable TCP_NODELAY for output socket
This makes us send data immediately, giving a much snappier
over-network experience.
2011-03-15 11:47:38 +01:00
Alexander Larsson
7605258890 broadway: Fix up whitespace and indentation for js code 2011-03-15 10:33:08 +01:00
Alexander Larsson
520dd09e8a broadway: Use camelCase for all js code 2011-03-15 10:26:53 +01:00
Alexander Larsson
2635a27814 broadway: Fix flicker when resizing windows
Resizing a canvas causes a clear, so we have to save the previous
content and restore to avoid flickering.
2011-03-15 10:18:07 +01:00
Alexander Larsson
e3a2176a1f broadway: double buffer window updates
Ensure that we're writing all the updates for a single rendering op
in one go without callbacks inbetween. That way some rendering will
be delayed, but the user will never see partial renderings.
2011-03-15 09:50:07 +01:00
Alexander Larsson
58c234e7d0 broadway: Don't crash if output is NULL 2011-03-15 08:50:18 +01:00
Alexander Larsson
4408e9d958 broadway: Implement gdk_broadway_device_window_at_position
This is required for ungrabs to work properly
2011-03-14 21:40:59 +01:00
Alexander Larsson
08f832908e broadway: Ensure we begin a path when clipping 2011-03-14 20:59:28 +01:00
Alexander Larsson
acd72d0961 broadway: Do copy rects with compositing mode "copy" 2011-03-14 20:59:00 +01:00
Alexander Larsson
a5e5e2343c broadway: Fix undefined variable error in js 2011-03-14 16:38:24 +01:00
Alexander Larsson
63c0198347 broadway: Start windows transparent rather than black
This avoids flashing
2011-03-14 16:04:34 +01:00
Alexander Larsson
084003953d broadway: Make broadway port configurable with BROADWAY_DISPLAY 2011-03-14 15:58:55 +01:00
Alexander Larsson
9214796a4d broadway: Report right coordinates on ungrab enter 2011-03-14 15:46:29 +01:00
Alexander Larsson
99d194b747 broadway: Fix various typos in mouse button event reporting 2011-03-14 15:24:25 +01:00
Alexander Larsson
ca203adc73 broadway: Fix up grab events, its "mode" not "detail" we send 2011-03-14 12:13:21 +01:00
Alexander Larsson
a1de735b87 broadway: Track button state 2011-03-14 12:09:19 +01:00
Alexander Larsson
e53abee805 broadway: Fix time in ungrab 2011-03-14 12:02:18 +01:00
Alexander Larsson
95b19bca33 broadway: Implement pointer grabs 2011-03-14 11:52:46 +01:00
Alexander Larsson
7d2ff79ddf broadway: Fix some window coordinate reporting issues 2011-03-14 11:28:57 +01:00
Alexander Larsson
cf6bf44184 broadway: Remove debug code and fix whitespace issues 2011-03-14 11:21:37 +01:00
Alexander Larsson
c2ce462486 broadway: Add debug logging framework for js 2011-03-14 10:05:24 +01:00
Alexander Larsson
e2f8215751 broadway: Fix typo that broke window hiding 2011-03-14 09:51:54 +01:00
Alexander Larsson
6713fe9ca4 broadway: Get query_state window coords from browser side 2011-03-11 21:39:11 +01:00
Alexander Larsson
27848432c7 broadway: Split out getPositionsFromAbsCoord from getPositionsFromEvent 2011-03-11 21:28:39 +01:00
Alexander Larsson
54905a8986 broadway: Fix up a bunch of js style issues 2011-03-11 21:12:57 +01:00
Alexander Larsson
cc808ae063 broadway: Move event coordinate calculation to browser side 2011-03-11 21:10:23 +01:00
Alexander Larsson
0cefd54122 broadway: Implement pointer query_status 2011-03-11 14:56:31 +01:00
Alexander Larsson
614eb3b3d7 broadway: Add _gdk_broadway_display_block_for_input 2011-03-11 14:45:13 +01:00
Alexander Larsson
e08396450d broadway: Break out websockets parsing and message processing
We need this to be able to correctly handle the recieve buffer
during message processing. Without the split we would be
recursing over the use of it.
2011-03-11 14:41:03 +01:00
Alexander Larsson
7c12e5f27e broadway: Implement gdk_display_flush 2011-03-11 14:37:39 +01:00
Alexander Larsson
71aa55d291 broadway: Call device vfunc to get device state
We want only one place where we get device state.
2011-03-11 08:26:37 +01:00
Alexander Larsson
0fa32e98a4 broadway: Change input handling to use polling rather than async reads
We do this because we need to be able to switch to using sync reads
when we're doing a roundtripping call, and that is too complex
with the async code.
2011-03-10 21:22:19 +01:00
Alexander Larsson
d4e2414d4a broadway: Add serial tracking and roundtripping 2011-03-10 14:58:47 +01:00
Alexander Larsson
3914d0af38 broadway: Clean up protocol message writing a bit
Centralize the header writing so we can extend it later.
Don't opencode the size of element when increasing p.
2011-03-10 13:59:30 +01:00
Alexander Larsson
d8f061ad42 [broadway] Update to new GDK backend APIs 2011-02-11 15:59:50 +01:00
Alexander Larsson
a3b227ff9e [broadway] Remove unused grab_count from GdkBroadwayDisplay
We don't need this anymore since server grabs is now an x-only feature
2011-01-20 13:40:41 +01:00
Alexander Larsson
cbc324d846 [broadway] Prefix internal functions with broadway 2011-01-20 13:40:34 +01:00
Alexander Larsson
2c0012b76b [broadway] Remove gdk_set_locale 2011-01-20 13:19:01 +01:00
Alexander Larsson
549610a8dd [broadway] Remove unused input window stuff 2011-01-20 13:18:15 +01:00
Alexander Larsson
60c2b80bf0 [broadway] Remove all leftover _gdk_windowing_ functions 2011-01-20 13:12:26 +01:00
Alexander Larsson
07db0e38b0 [broadway] Make broadway build with new gdk-backend setup
Convert all global functions to vtable calls, etc.
2011-01-19 19:52:51 +01:00
Alexander Larsson
190f533258 [broadway] Remove unnecessary backend-specific function
These were just blindly copied from the X backend
2010-12-04 22:59:04 +01:00
Alexander Larsson
7dbbc54370 [broadway] Remove unneeded _gdk_window_impl_get_type call 2010-12-04 22:54:45 +01:00
Alexander Larsson
895922569e [broadway] Update to the new drawable-less APIs 2010-12-04 22:31:28 +01:00
Alexander Larsson
80f332308f [broadway] Add initial keyboard event support 2010-11-25 22:09:34 +01:00
Alexander Larsson
4aac045a30 [broadway] Don't return undefined counts in keymap calls 2010-11-25 22:09:34 +01:00
Alexander Larsson
667d23aa7c [broadway] Hook mousewheel scrolling 2010-11-25 22:09:33 +01:00
Alexander Larsson
d6029949e6 [broadway] Disable context menu so rmb works 2010-11-25 22:09:33 +01:00
Alexander Larsson
4004882b92 [broadway] Only change window positioning for toplevels not e.g. menus 2010-11-25 22:09:33 +01:00
Alexander Larsson
c1a35afa5f [broadway] Don't have mouse_in_toplevel point to hidden or destroyed window 2010-11-25 22:09:33 +01:00
Alexander Larsson
0b6265b76a [broadway] Only allow one input session 2010-11-25 22:09:33 +01:00
Alexander Larsson
a4fc901c07 [broadway] Handle errors in input nicer
Also, fix a leak
2010-11-25 22:09:33 +01:00
Alexander Larsson
9cc073803f [broadway] Only open one websocket for input! 2010-11-25 22:09:33 +01:00
Alexander Larsson
e7169f75e6 Move send_error up 2010-11-25 22:09:33 +01:00
Alexander Larsson
1b3efb3599 Save current input request 2010-11-25 22:09:33 +01:00
Alexander Larsson
1ba38a48d7 [broadway] Remove old unused declarations 2010-11-25 22:09:33 +01:00
Alexander Larsson
7667ad456b [broadway] Avoid crash if mask is NULL 2010-11-25 22:09:33 +01:00
Alexander Larsson
b23fd41449 [broadway] Fix warning 2010-11-25 22:09:33 +01:00
Alexander Larsson
ccab600fb4 Move event generation to gdkeventsource.c 2010-11-25 22:09:33 +01:00
Alexander Larsson
0539303dfc Handle output errors correctly 2010-11-25 22:09:33 +01:00
Alexander Larsson
0ca5a1a574 [broadway] Track errors in BroadwayOutput 2010-11-25 22:09:33 +01:00
Alexander Larsson
ce5cccf0ab [broadway] Fix typo in assignment 2010-11-25 22:09:33 +01:00
Alexander Larsson
e8117544a0 [broadway] Convert broadway.c to use glib stuff 2010-11-25 22:09:33 +01:00
Alexander Larsson
fcce2986ce [broadway] Keep track of the GSocketConnection for the output 2010-11-25 22:09:32 +01:00
Alexander Larsson
f407b4a5f5 Rename BroadwayClient to BroadwayOutput 2010-11-25 22:09:32 +01:00
Alexander Larsson
5a9f7a1e35 [broadway] Fix warning in demo 2010-11-25 22:09:32 +01:00
Alexander Larsson
1bc7bc5542 [broadway] Initialize masks to zero everywhere to avoid valgrind warnings 2010-11-25 22:09:32 +01:00
Alexander Larsson
77907fec79 Move global window list to per-display 2010-11-25 22:09:32 +01:00
Alexander Larsson
08a180a699 [broadway] Hack up window placement for demo 2010-11-25 22:09:32 +01:00
Alexander Larsson
b82ed84709 [broadway] Implement window resize 2010-11-25 22:09:32 +01:00
Alexander Larsson
65f767a363 [broadway] NULL out ref_surface on resize too 2010-11-25 22:09:32 +01:00
Alexander Larsson
2e1f6e09e5 [broadway] Add some fuzz to rectangle scanner
We don't want a bazillion tiny rectangles, so add some fuzz
to the rectangle scanners so we get less but larger rectangles.
2010-11-25 22:09:32 +01:00
Alexander Larsson
5ec2531e9b [broadway] Switch autocrop to smarter rectangle search 2010-11-25 22:09:32 +01:00
Alexander Larsson
e88a18e0ea [broadway] Add realloc wrapper 2010-11-25 22:09:32 +01:00
Alexander Larsson
d0e403c54d [broadway] Fix up scrolling 2010-11-25 22:09:32 +01:00
Alexander Larsson
bed0ccba9d [broadway] Handle window moves 2010-11-25 22:09:32 +01:00
Alexander Larsson
ec4a6c4a5f [broadway] Implement _gdk_windowing_window_at_device_position 2010-11-25 22:09:31 +01:00
Alexander Larsson
93fec05183 [broadway] Track last mouse position 2010-11-25 22:09:30 +01:00
Alexander Larsson
e64a38eeef [broadway] Fix x/y mismatch in canvas position 2010-11-25 22:09:30 +01:00
Alexander Larsson
5a49bfe96a Fix some type warnings 2010-11-25 22:09:30 +01:00
Alexander Larsson
e6c340519c [broadway] Send diffs as bilevel rgba instead of true diff
The true diff only works if the destination keeps perfect 32bit
canvas data, which is not always true. So, instead we send only
changed pixels, masking the others to 0 via alpha 0.
2010-11-25 22:09:30 +01:00
Alexander Larsson
6fe849d4f1 [broadway] Send and use canvas ids in events 2010-11-25 22:09:30 +01:00
Alexander Larsson
d211d78eef [broadway] Track window<->id mapping 2010-11-25 22:09:30 +01:00
Alexander Larsson
cdd274a55c [broadway] Missed a place to use event time 2010-11-25 22:09:30 +01:00
Alexander Larsson
8f9c6eb1a9 [broadway] clean up input sending js 2010-11-25 22:09:30 +01:00
Alexander Larsson
65d4edbd5b [broadway] Send event timestamps from client 2010-11-25 22:09:30 +01:00
Alexander Larsson
2e8f21cb1b [broadway] Allow loading client.html as "/" only 2010-11-25 22:09:30 +01:00
Alexander Larsson
2ee6dbd998 Remove unneeded copy of region 2010-11-25 22:09:30 +01:00
Alexander Larsson
163a278d13 Fix button numbers in events (starts with 1, not 0) 2010-11-25 22:09:30 +01:00
Alexander Larsson
884527a958 [broadway] Initial work on mouse events 2010-11-25 22:09:30 +01:00
Alexander Larsson
ee6b07bf15 [broadway] remove some spew 2010-11-25 22:09:29 +01:00
Alexander Larsson
95df67f47b [broadway] don't sync the root window 2010-11-25 22:09:29 +01:00
Alexander Larsson
0a20ab58fa [brodway] Don't send 0x0 deltas, they confuse the client 2010-11-25 22:09:29 +01:00
Alexander Larsson
1e3dffeee9 Send mouse events from js 2010-11-25 22:09:29 +01:00
Alexander Larsson
852b317b4f Initial sketch of websockets support 2010-11-25 22:09:29 +01:00
Alexander Larsson
f11a7d2fde Don't put output on stdin, instead do it on http connection 2010-11-25 22:09:29 +01:00
Alexander Larsson
8a0429b42d Flesh out http server to handle client.html and broadway.js 2010-11-25 22:09:29 +01:00
Alexander Larsson
b07ead64ed Add makerules to turn client.html and broadway.js into #include files 2010-11-25 22:09:29 +01:00
Alexander Larsson
ded9bc698b Add initial http server 2010-11-25 22:09:29 +01:00
Alexander Larsson
0b85341737 Add broadway javascript and html part 2010-11-25 22:09:29 +01:00
Alexander Larsson
6651eab293 [broadway] Initial hookup of broadway client 2010-11-25 22:09:29 +01:00
Alexander Larsson
cb056e3738 [broadway] Fix up nvisuals handling 2010-11-25 22:09:29 +01:00
Alexander Larsson
db288f3233 [broadway] Ensure gdk_ref_cairo_surface object can be destroyed
If we return a direct ref that is not possible, since we own a ref to it.
This is problematic as the gdkwindow.c code uses destruction to track
outstanding surfaces.

We fix this by returning a subsurface.
2010-11-25 22:09:29 +01:00
Alexander Larsson
f02b7c9ed2 [broadway] Copy regions on last_surface during translations too
This will help make scrolling more efficient
2010-11-25 22:09:29 +01:00
Alexander Larsson
60cf2d53eb Track last_surface properly 2010-11-25 22:09:29 +01:00
Alexander Larsson
7f0e43c0fd [broadway] Import broadway lib
We put this in gtk+ for now since it will be synced initially, but
it avoids using glib so that it can be used lower in the stack if
required (e.g. in cairo later).
2010-11-25 22:09:29 +01:00
Alexander Larsson
d707d057c2 [broadway] Rename X11 -> Broadway in all code
This just runs:
for i in *.[ch]; do
 sed -i s/DisplayX11/DisplayBroadway/g $i;
 sed -i s/PrivateX11/PrivateBroadway/g $i;
 sed -i s/ImplX11/ImplBroadway/g $i;
 sed -i s/KeymapX11/KeymapBroadway/g $i;
 sed -i s/ScreenX11/ScreenBroadway/g $i;
 sed -i s/GdkX11Monitor/GdkBroadwayMonitor/g $i;
 sed -i s/_X11/_BROADWAY/g $i;
 sed -i s/x11/broadway/g $i;
done
2010-11-25 22:09:29 +01:00
Alexander Larsson
ce6ae54607 [broadway] Send MAP/UNMAP events for impl windows 2010-11-25 22:09:29 +01:00
Alexander Larsson
2ecaeb149f [broadway] Implement window translation 2010-11-25 22:09:28 +01:00
Alexander Larsson
73f9c0cc00 [broadway] Track dirty windows 2010-11-25 22:09:28 +01:00
Alexander Larsson
85515b7775 [broadway] Keep track of all (toplevel) windows 2010-11-25 22:09:28 +01:00
Alexander Larsson
c456e98880 Remove X use from broadway backend 2010-11-25 22:09:28 +01:00
Alexander Larsson
dffa6e0da7 Remove X based dnd 2010-11-25 22:09:28 +01:00
Alexander Larsson
a54e556ad8 Remove event translators 2010-11-25 22:09:28 +01:00
Alexander Larsson
5b480e1b0d [broadway] Copy X backend to broadway 2010-11-25 22:09:19 +01:00