Commit Graph

57636 Commits

Author SHA1 Message Date
Adrien Destugues
f69717add6 FirstBootPrompt: more layout fixes
ResizeToPreferred will only relayout the window once. Further calls will
not change anything, even if the text in the BTextView changed. So make
sure to compute the preferred size with a very high text view, and only
then, set the (rather short) english text.

This makes the text view large enough to fit the text in all languages,
and the window never changes size.
2017-11-22 16:34:11 +01:00
François Revol
f254805b43 usb_webcam: UVC: guard against NULL config or interface from USB device 2017-11-22 14:06:06 +01:00
François Revol
9c7aacad7b Typo 2017-11-22 14:06:06 +01:00
Adrien Destugues
c247a73bea app_server: handle empty drag bitmap
An application is allowed to set an empty drag bitmap. In that
case, the offset from the cursor doesn't matter, because there
is nothing to draw anyway.

app_server would end up confused by the empty bitmap (which has
no bits) and invalid offset (it would try to allocate a 2^16
x 2^16 pixels bitmap to fit both the cursor and the empty
bitmap), and eventually it would crash.

Fixes #13577.
2017-11-22 13:54:12 +01:00
Augustin Cavalier
8742c1d044 Tracker: Remove now-unused bool displayingSymlink argument from InfoWindowRect. 2017-11-22 11:36:36 +01:00
John Scipione
a75fc8a7ab Keymap: simplification
Call already existing Offset() method instead of reproducing it.

Set fCharsSize in BKeymap::SetToCurrent()
2017-11-21 14:48:54 -08:00
Augustin Cavalier
164e4f8de4 intel_extreme: Beginnings of Broadwell support.
At present, does not work (it fails to properly set up interrupts,
resulting in thousands of unhandled ones which all but grinds the system
to a halt) but this at least is some progress.
2017-11-21 23:37:18 +00:00
Michael Lotz
cec4fe2f85 app_server: Remove stubbed HTML5 HWInterface.
It was mostly a renamed copy of the remote HWInterface with
beginnings of a webserver and client. It never became actually
functional.
2017-11-21 23:31:44 +01:00
Michael Lotz
83241299ce Move the HTML5 remote desktop client to src/tools. 2017-11-21 22:28:07 +01:00
Michael Lotz
e30d37ddd6 RemoteHWInterface: Fix build with tracing disabled. 2017-11-21 22:23:16 +01:00
Michael Lotz
85195eb807 Add a HTML5 client for the remote desktop protocol.
It is implemented using websockets and canvas darwing. It directly
speaks the remote desktop protocol. A websocket proxy that translates
the TCP connection into a usable form is needed. Websockify works for
this out of the box directly under Haiku.

Note that not all drawing modes are implemented, and most of them don't
have a good match on the canvas side. Fonts are also not properly
supported yet. A sans serif font will be used on the client for
everything and the metrics between the client and server will diverge
and cause drawing artifacts.

Usage:

* Run an application with a target screen to create the desktop:

	TARGET_SCREEN=5001 Terminal

* Use a websocket proxy to expose the port via websockets:

	websockify.py 5000 localhost:5001

* Open HaikuRemoteDesktop.html in a browser and connect.

To get the full desktop experience you may want to run Tracker and
Deskbar inside the virtual desktop. As they are both single launch
and controlled by the launch_daemon, you have to stop them via:

	launch_roster stop x-vnd.be-trak
	launch_roster stop x-vnd.be-tskb

And then start them manually from within the virtual desktop:

	/system/Tracker &
	/system/Deskbar &
2017-11-21 22:18:17 +01:00
Michael Lotz
778469156a RemoteHWInterface: Add mechanism to retrieve the system palette.
This isn't used by the Haiku client as the palette is hardcoded.
2017-11-21 22:18:17 +01:00
Michael Lotz
4d9d6d7ee3 RemoteMessage: Guard against NULL source/target.
To make it more obvious in case it is ever used the wrong way.
2017-11-21 22:18:17 +01:00
Michael Lotz
703667a98d RemoteEventStream: Guard against unreasonably large input. 2017-11-21 22:18:17 +01:00
Michael Lotz
60882f20e1 RemoteDrawingEngine: Reduce RP_READ_BITMAP result timeout. 2017-11-21 22:18:17 +01:00
Michael Lotz
0863572d73 RemoteDrawingEngine: Whitespace cleanup and a simplification. 2017-11-21 22:18:17 +01:00
Michael Lotz
46f8876d27 RemoteMessage: Make some message parts fixed size.
So they don't differ across architectures.
2017-11-21 22:18:17 +01:00
Michael Lotz
ebf043b962 RemoteHWInterface: Fix 64 bit build with tracing enabled. 2017-11-21 22:18:17 +01:00
Michael Lotz
82873c6ece RemoteHWInterface: Fix lost drag bitmap on cursor change.
The drag bitmap was lost because the original, uncombined, cursor was
sent on cursor change.
2017-11-21 22:18:17 +01:00
Michael Lotz
4d9e21b824 Remote{Message|DrawingEngine}: Add some more debug output. 2017-11-21 22:18:17 +01:00
Michael Lotz
5fb27ee2c4 RemoteDrawingEngine: Implement StringWidth.
It doesn't actually seem to be called though.
2017-11-21 22:18:17 +01:00
Michael Lotz
df55bcf5a0 RemoteDrawingEngine: Fix position of gradient in FillShape.
It wasn't added at the end.
2017-11-21 22:18:17 +01:00
Michael Lotz
91c1d3dbb3 RemoteDesktop: Implement support for BAffineTransform.
It is currently somewhat broken client side though.
2017-11-21 22:18:17 +01:00
Michael Lotz
f7fb4538de RemoteDesktop: Create states for unknown tokens.
This allows to recover from reconnects where creation of some tokens
may have taken place before the client was fully connected.
2017-11-21 22:18:17 +01:00
Michael Lotz
f609f4fa64 RemoteHWInterface: Use screen change listener to update mode.
This allows dynamic reconfiguration of the size of the virtual desktop
to the dimensions desired by the client.
2017-11-21 22:18:17 +01:00
Michael Lotz
f3e8ed4d48 app_server: Implement screen changed hooks and notifications.
The ScreenOwner interface gets an additional ScreenChanged() hook. It
is implemented in the Desktop class to automatically set the preferred
screen mode on the changed screen.

The HWInterfaceListener, previously only used by the downstream
DrawingEngine, gets an additional ScreenChanged() hook as well to inform
an upstream client of a changed screen.

The ScreenManager ties these two mechanisms together.
2017-11-21 22:18:17 +01:00
Michael Lotz
5ed41cffff RemoteDesktop: Switch connection direction and simplify client.
Instead of the server connecting back to a listening client, make it
into a more traditional setup with the server listening on a port and
the client connecting to it.

The client can now either connect directly, unencrypted and without the
ability to trigger listening and specifying a command, or through SSH,
as before with the possibilty to run a target application and causing
the creation of the listener.

With the direction change, there's only the need for one, local, port
forward with SSH, which simplifies things.
2017-11-21 22:18:17 +01:00
Adrien Destugues
b140a1c340 NetworkAddressResolver: cache needs to be locked
It is not a good idea to have a thread get an address from the request
cache, while another thread is deleting said address as the cache has
grown too large. Add a lock around the cache access to make it safe.
2017-11-21 22:15:32 +01:00
Adrien Destugues
4c99992724 Deskbar: update time format when locale changes.
Thanks to Skipp_OSX for reminding me that B_LOCALE_CHANGED was already
handled in Deskbar.
2017-11-21 22:15:31 +01:00
François Revol
e96fd79311 ata_adapter: Remove bad casts for ram_address()
We now accept and return a phys_addr_t as we ought to.
2017-11-21 21:44:02 +01:00
François Revol
4dde854c8a silicon_image_3112: Remove bad casts for ram_address()
We now accept and return a phys_addr_t as we ought to.
2017-11-21 21:44:02 +01:00
François Revol
aef94baf32 ISA: fix ram_address() to use phys_addr_t for completeness
I don't know of any driver actually making use of it, but some weird
architecture might want to emulate an ISA bus to reuse a driver maybe...
2017-11-21 21:44:02 +01:00
François Revol
16bb99fdac PCI: fix ram_address() to use phys_addr_t
Since it handles physical address it should really be this.

It's not like many drivers actually used it anyway. It shouldn't harm
compatibility, drivers calling it with only 32bit would leave garbage in
the higher bits but since on x86 it's a noop anyway, it would end up in
the MSB register tha's ignored because it expects a 32bit result.
2017-11-21 21:44:01 +01:00
Janus
66672a5fa4 Fix broken convention 2017-11-21 21:32:21 +01:00
Kacper Kasper
2b7297f879 DeskCalc: accept file drops.
* Fixes #9283.
2017-11-21 21:15:16 +01:00
Janus
d18b272d3e [PowerStatus] The menu item quit doesn't close the Tracker
* Fixes #13790
2017-11-21 18:13:00 +01:00
Kacper Kasper
f4a1f9c06a ICNSTranslator: add missing B_TRANSLATEs. 2017-11-21 20:08:29 +01:00
Kacper Kasper
2c856023e9 DeskCalc: fix cut off buttons.
* Window frame might change based on set size limits.
  Creating view with rectangle used to create the window causes it
  to anchor outside the window.
  To address that pass current frame rectangle to the view.
* Fixes #13167.
2017-11-21 20:08:29 +01:00
Adrien Destugues
6663167b59 pkgman: improve progress bar
- Do not update more than twice a second
- Do not use tabs, so we can reliably compute the string width
- Cleanup and tweak other parts of the code

There is still a glitch when resizing Terminal, but it isn't as bad as
before. Ideally, using the SIGWINCH signal would solve that, but it is
sent to the app only when you release the mouse after a release
operation, so in our case, it is already too late.
2017-11-21 18:24:44 +01:00
Adrien Destugues
feabff3ebb TeamMonitor: redo layout
Add several sizing constraints to avoid the window becoming too small.

Fixes #7560.
2017-11-21 16:16:12 +01:00
Augustin Cavalier
3b3688c7a5 fs_shell: Change {set_}real_time_clock to match the new definitions. 2017-11-21 15:18:11 +01:00
Adrien Destugues
8c82d0edd5 DeskBar: cache time and date formats
Creating BDateTimeFormat and BDateFormat objects is a costly operation
(it loads locale data from ICU, etc). So, we should do it only once when
the format changes, instead of doing it each time we format a date
or time.
2017-11-21 15:06:46 +01:00
Janus
b06e48bb2b [PowerStatus] Avoid crashes on exit when Info window is opened
* Fixes #10885
2017-11-21 14:26:49 +01:00
Adrien Destugues
950b5664df FirstBootPrompt: fix layout
In some languages, the buttons would end up outside of window bounds, as
changing the BTextView content does not automatically update the window
size (even with B_AUTO_UPDATE_SIZE_LIMITS). So, we need to manually call
ResizeToPreferred after changing the text.

However, this exposed another problem: the view size is computed using
GetHeightForWidth, with a width as small as allowed by layout
constraints. In our cases, there weren't much layout constraints so we
would end up asking the text view to compute its height for a width of
52px, leading to a very high window. Add some explicit sizing
constraints to the text view and language list to make sure we get a
sane size.

Also tweak the layout a little to allow the keymap menu field to be
wider than the language list view, and make the window not resizable as
that makes it much easier to keep things under control and there isn't
really a need to resize it.
2017-11-21 12:19:56 +01:00
Adrien Destugues
24e63de5d3 Style fix: parameters should have a name. 2017-11-21 12:19:56 +01:00
Kacper Kasper
830758ad45 PowerStatus: convert to BTabView.
* Move text inside battery if possible.
* Fix location of the spark.
* Fixes #5422 and #7330.
2017-11-21 10:31:33 +01:00
Kacper Kasper
d1929affbb PowerStatus: use layout to draw info strings. 2017-11-21 10:31:32 +01:00
Adrien Destugues
3a2b67b5ae Support for configuring screen backlight
Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

App_server:
Forward brightness things between BScreen and the accelerant.

intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.
2017-11-21 09:12:18 +01:00
Adrien Destugues
c5f9934cd8 SerialConnect: optimize drawing
The libvterm implementation was sending characters to app_server one by
one. This made it very slow to update the view and SerialConnect would
have noticeable flickering.

We now look through each line and try to find ranges of characters with
the same attributes. We can then draw each of these with a single
FillRect+DrawString. In the normal case (no special attributes or colors
anywhere), this means just one call per line, plus two for the cursor.
2017-11-20 21:54:30 +01:00
François Revol
dd1454bd96 Defer calling arch_debug_console_init_settings
when we can actually read driver settings :-)
2017-11-20 18:16:54 +01:00