Skip to content

Commit ef60910

Browse files
committed
Display (Haiku): code cleanup; detect manufacture date
1 parent 565934b commit ef60910

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/detection/displayserver/displayserver_haiku.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
extern "C" {
22
#include "displayserver.h"
3-
#include "common/settings.h"
4-
#include "common/processing.h"
53
}
64

75
#include <math.h>
@@ -31,15 +29,16 @@ static void detectDisplays(FFDisplayServerResult* ds)
3129
monitor_info monitor;
3230
// WARNING: This is experimental new Haiku API
3331
status_t err = s.GetMonitorInfo(&monitor);
34-
if (err == B_OK) {
32+
if (err == B_OK)
33+
{
3534
ffStrbufSetF(&name, "%s %s", monitor.vendor, monitor.name);
3635
ffStrbufTrimRightSpace(&name);
3736
}
3837

3938
uint32_t width = (uint32_t) s.Frame().Width() + 1;
4039
uint32_t height = (uint32_t) (uint32_t)s.Frame().Height() + 1;
4140
double scaleFactor = (double) 1.0;
42-
ffdsAppendDisplay(ds,
41+
FFDisplayResult* res = ffdsAppendDisplay(ds,
4342
width,
4443
height,
4544
(double)mode.timing.pixel_clock * 1000 / (mode.timing.v_total * mode.timing.h_total),
@@ -52,11 +51,16 @@ static void detectDisplays(FFDisplayServerResult* ds)
5251
&name,
5352
FF_DISPLAY_TYPE_UNKNOWN,
5453
main,
55-
s.ID().id,
54+
(uint64_t) s.ID().id,
5655
0,
5756
0,
5857
"BScreen"
5958
);
59+
if (err == B_OK)
60+
{
61+
res->manufactureWeek = monitor.produced.week;
62+
res->manufactureYear = monitor.produced.year;
63+
}
6064
main = false;
6165
} while (s.SetToNext() == B_OK);
6266

0 commit comments

Comments
 (0)