Commit Graph

48703 Commits

Author SHA1 Message Date
Augustin Cavalier
a20f4f8a85 MidiSettings: Don't leak settings in failure case.
CID 1422944.
2017-11-23 19:40:03 +01:00
Augustin Cavalier
d692d22c9d debugger/elf: Don't leak memory in failure case.
CID 1423098.
2017-11-23 19:40:02 +01:00
Augustin Cavalier
7131246873 BNetworkAddress: Close socket in ResolveForDestination.
It was closed on all the failure cases but not on the success one.
Found by Coverity.
2017-11-23 19:40:02 +01:00
Augustin Cavalier
75fa008e23 BProxySecureSocket: Fix obviously untested code.
* Actually set status before testing it
 * sscanf (reads from passed buffer) not scanf (reads from stdin)
 * &httpStatus not httpStatus.

Found by Coverity.
2017-11-23 19:40:01 +01:00
Augustin Cavalier
14fcbb52cd device_interfaces: Fix memory leak on success.
The module list was closed properly at the end of the function body
(failure case) but not inside the loop on the success case.

CID 605738.
2017-11-23 19:40:00 +01:00
Humdinger
4d87bc24d4 DeskCalc: Improve removal of newlines of dropped files
Thanks to Adrien for the pointers.
2017-11-23 18:18:01 +01:00
Alexander von Gluck IV
eb81dec460 kernel/u-boot: Add a few missed fdt compat's for omap uart 2017-11-23 10:25:18 -06:00
Jérôme Duval
a99d222832 usb_ecm: support for QEmu CDCE network device.
* the CDCE configuration happens to not be the first: iterate the configurations.
* we set the alternate control interface
* queue interrupt requests once opened.
2017-11-23 16:50:23 +01:00
Adrien Destugues
4205fc9141 locale: document -c as the shortcut to get message locale again.
It was deprecated in favor of -m, but -m then changed meaning to comply
with POSIX. So restore documentation for -c, and add proper
documentation for -m.
2017-11-23 14:50:11 +01:00
Adrien Destugues
eb5604bcb0 UDP: keep a reference to domain when we need it
The domains could be deleted by other threads while we were using them
to handle incoming packets, leading to an use after free (deadbeef).

Keep a reference to the doamin as long as we need it so other threads
will not delete them.

Fixes #9721, #12567
2017-11-23 12:11:09 +01:00
hyche
11dee0444f TextInput: Fix text width
Thanks PulkoMandy for teaching me how to use Debugger and part of the interface kit..
Fixes #12608

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Thanks for investigating and finding the problem!
2017-11-23 11:06:25 +01:00
Adrien Destugues
a61d30b83b Fix app_server build for brightness support
Thanks to Hy Che for noticing this!
2017-11-22 23:17:51 +01:00
Humdinger
6a35420117 DeskCalc: remove trailing newlines of dropped files
Initialize the buffer.
Remove trailing newlines. Before, the dropped expression would
'scroll' out of view if it happened to have a newline at the
end.
Thanks to DeadYak for helpful input which pretty much changed
my original code about 98%...
2017-11-22 19:25:16 +01:00
Augustin Cavalier
df9bc792e0 runtime_loader: Set sSearchPathSubDir on first image, not on app image.
Under normal conditions this will behave identically. But when using LD_PRELOAD
or the like, some shared objects (and dependencies) are loaded before the
app image is, and on the secondary arch on hybrid builds, will fail to load
any of their dependencies due to sSearchPathSubDir not being set.

Fixes #12214, which had plagued users of libroot_debug for a long time now.
2017-11-22 17:55:36 +01:00
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
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
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
François Revol
7c7390c719 work around "cast specifies signature type" from gcc2
...when build by gcc6 or 7 on my Debian Sid.
2017-11-20 17:18:08 +01:00
Alexander von Gluck IV
2dce5eecef build/arm: Correct missing sources in search
* Group into local var to prevent recurrence.
2017-11-20 09:36:56 -06:00
Alexander von Gluck IV
a42249db2d arm: Add 8250 omap variant uart driver
* Untested, someone with an omap3,4,5 could though.
2017-11-20 09:16:58 -06:00
François Revol
0835170c80 Actually use the serial port and speed from the kernel settings
Turns out we just reused the already set values, disregarding the new ones.
2017-11-20 11:44:43 +01:00
François Revol
587b70d5cd Add a get_driver_settings debugging tool 2017-11-20 11:23:34 +01:00
Adrien Destugues
d1805b9a36 BSecureSocket: use opt-out to select ciphersuites.
We just want to disable known broken ones, rather than opt-in for
working ones. This keeps the list of authentications shorter and is more
future proof.
2017-11-20 09:44:50 +01:00
Adrien Destugues
c312da45a8 media_client: print usage in case of missing arguments
Now the obvious "media_client somefile.wav" will tell you what to do.
2017-11-20 09:44:50 +01:00
Jérôme Duval
1f384bf443 atheros813x and attansic_l1: also switch the mii Jamfiles. 2017-11-19 12:45:26 +01:00
Jérôme Duval
c6ca84c3a0 attansic_l2: sync with FreeBSD 11.1. 2017-11-19 11:54:19 +01:00
Jérôme Duval
c8f44197fe attansic_l1: sync with FreeBSD 11.1. 2017-11-19 11:44:23 +01:00
Jérôme Duval
cf42509b42 atheros813x: sync with FreeBSD 11.1. 2017-11-19 10:33:39 +01:00
John Scipione
5c6208cc0c Tracker: Line TitleView up with scroll bar arrow
Make TitleView a few pixels shorter at the default font size so that
it lines up with the scroll bar arrow to its immediate right.

Note the font size used in the title view before and still is 9px
(12px * 3/4)

Make this the minimum TitleView height even for smaller font sizes
so that the title view never is shorter than the height of a
scrollbar button.  Make the minimum font size for TitleView 8px
because 6px (8px * 3/4) was just too small to read.

As font size is made larger it will increase the height of the
titlebar to accomodate the increased font size and consequently no
longer line up with the scrollbar arrow.

The code to scale the bar height via the font height was taken from
BColumnListView. The code to position the title in the middle of the
title bar was also taken from BColumnListView.

Some included style fixes:
* Rename height to fontHeight
* Rename loc to titleLocation
* 80 column limit
2017-11-18 16:25:01 -08:00
Janus
24c9b9df7a [PowerStatus] Fixes some drawing glitches
* Fixes the position of the lightning over the battery
* Fixes the selection in the info Window (Why is the selected color hardcoded?)
* Fixes #13784
2017-11-19 01:05:38 +01:00
Jérôme Duval
aafb7e69a9 ipro1000: MSI interrupts use a handler, no check needed.
tested on Qemu with model=e1000e.
2017-11-18 23:10:25 +01:00
Alexander von Gluck IV
f6c47144a6 kernel/uart: Refinements to irq and FIFO management 2017-11-18 13:20:53 -06:00
Alexander von Gluck IV
dc9cdc37d0 dtb/rpi2: Correct UART base frequency.
* https://github.com/raspberrypi/firmware/issues/643
* Mimics what the RaspberryPi guys adjusted it to in
  the firmware.
* Solves corrupted UART serial on the RaspberryPi 2
* I think linux live-probes this frequency via dt-bindings.
2017-11-18 13:20:52 -06:00
Jérôme Duval
dcdad04383 pcnet: Update with the 11.1 release of the le/pcn driver.
* switch compat layer.
* tested on Qemu, model=pcnet.
2017-11-18 18:45:37 +01:00
Jérôme Duval
ad7432f214 freebsd11_network: adapt code based on needs of the pcnet R11.1 driver. 2017-11-18 18:44:18 +01:00
Jérôme Duval
45b4110c1c ipro100: Update with the 11.1 release of the fxp driver.
* switch compat layer.
* tested on Qemu, model=i82557b.
2017-11-18 18:14:52 +01:00
Jérôme Duval
5dc915bd4d freebsd11_network: adapt code based on needs of the ipro100 R11.1 driver. 2017-11-18 18:13:33 +01:00
Jérôme Duval
f57e467bd8 Update libroot stubs. 2017-11-18 17:28:06 +01:00
Jérôme Duval
edfefa187b libroot/posix: remove useless keyword extern. 2017-11-18 17:28:06 +01:00
Janus
23871bd25d [PowerStatus] Fix different problems with the replicant
* Fixes #11329
2017-11-18 17:11:07 +01:00
Jérôme Duval
7472cf5784 rtl8139/rtl81xx: Update with the 11.1 release of re and rl drivers.
* switch compat layer.
* tested on Qemu and RTL8168 rev 10.
2017-11-18 16:40:39 +01:00
Jérôme Duval
76ad0d68c3 freebsd11_network: adapt code based on needs of the rtl81xx R11.1 driver. 2017-11-18 16:34:12 +01:00
Alexander von Gluck IV
1d3d336a97 libbsd: Move lutimes to bsd compat
* Rework be149e8ccf since lutimes isn't posix
2017-11-17 14:27:26 -06:00
John Scipione
015b5dd659 Deskbar: replicant tray width adjust for 2 draggers
Revision of last commit, everything I said about how we needed to
use 8px instead of 12px for the drag width and replicant tray
padding was correct, BUT, because we are subtracting from the
window width setting we need to account for the width of BOTH
draggers, so it becomes 2 * 8px or 16px that needs to be
subtracted -- sorry about that.

The minimum Deskbar width was calculated to fit 6 replicant icons,
however, this calculation doesn't take into account the extra width
taken up by the recently added second dragger. Consequently only 5
16x16 replicants currently fit.

However you can expand Deskbar to fit 6 (or more) icons now so it
is not a big deal.

Would it be desirable to adjust the minimum Deskbar width to fix 6
replicant icons again?
2017-11-16 16:30:19 -08:00
John Scipione
bc08a7d6c8 Fix first replicant wrapping bug on wide clock
In this commit:
a44504a168
    Deskbar: Refactor TRelicantTray::LocationForReplicant()

I made the following assumption that:
    * if index == 0 return right away, no calculation required.

But this assumes that the first replicant will always fit on the
same line as the clock which doesn't work if you have a wide clock.

Update to always calculate the position even of the first replicant
in vertical (multi-row) mode.

In horizontal mode we still skip some calculations for the index 0
case.

Also I was using kClockMargin (12px) for the right margin, the
right margin should be only 8px: 5px for the dragger plus 3px more
for kTrayPadding. Finally we add in the width of the clock and
extra clock margin iif we're on first row and clock is not hidden.

Fixes (hopefully the last of) #8641
2017-11-16 15:19:54 -08:00
John Scipione
aa19dd0236 BSpinner: Draw spinner buttons activated if mouse down
Fixes #13469
2017-11-16 14:11:01 -08:00
John Scipione
6a634757e6 BSpinner: Draw spinner plus sign better
The plus was a bit too tall making it look odd.
2017-11-16 11:59:16 -08:00
Augustin Cavalier
7d8eb4d7f9 time: Address review comments.
* Use ENOSYS not B_DONT_DO_THAT (thanks korli)
 * Use unsigned long not uint64 (thanks axeld)
2017-11-16 20:53:14 +01:00
Humdinger
16af9b4c61 Style, no functional changes
Make termination consistant with that last commit hrev51521.
As wished and proof-read by waddlesplash. Hope all's well...
2017-11-16 19:47:59 +01:00
Jérôme Duval
0e9000201f POSIX: shm_open: set the FD_CLOEXEC file descriptor flag...
on the new file descriptor.
Fixes #13774.
2017-11-16 16:46:37 +01:00
Alexander von Gluck IV
be149e8ccf libroot/posix: Add lutimes for better posix compatibility
* Didn't exist on BeOS, but exists most other places.
* Update times of a file, not following symbolic links.
2017-11-16 00:38:54 -06:00
Andrew Lindesay
f69a80b4bb HaikuDepot: Handling Corrupted Download Data
Damage in latter portions of the downloaded package data can cause the
meta-data for the caching to load OK, but the actual data is unable to
be parsed.  In this case, the application can fail to refresh the
broken data.  This change will mean that the data is "moved aside" into
another file so that on the next run, the application will load fresh
data in place.
2017-11-15 22:32:06 +01:00
Jérôme Duval
b3fb200fe3 ipro1000: Update with the 11.1 release of the e1000 driver.
* switch compat layer.
* tested on Qemu and Intel I217-LM.
2017-11-15 21:22:02 +01:00
Jérôme Duval
078cb10834 freebsd11_network: adapt code based on needs of the e1000 R11.1 driver. 2017-11-15 21:21:44 +01:00
Jérôme Duval
f9a21cf8ba freebsd11_network: copy freebsd_network from 9.3. 2017-11-15 21:20:07 +01:00