Compare commits
No commits in common. "dea1e15e75273d81cc0b772f2822dc2a20ab7c5d" and "01fbcedf24b6ee6f2da71e342406e9ec86eecd03" have entirely different histories.
dea1e15e75
...
01fbcedf24
22
sortix.c
22
sortix.c
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <sys/keycodes.h>
|
||||
|
||||
#include <err.h> //debg
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -126,21 +127,17 @@ static void sortix_process_events(void *data)
|
|||
|
||||
static unsigned char *sortix_init_driver(unsigned char *param, unsigned char *display)
|
||||
{
|
||||
if (param) {
|
||||
if (sscanf(param, "%ix%i", &default_window_width, &default_window_height) != 2)
|
||||
return stracpy("-mode syntax is WIDTHxHEIGHT\n");
|
||||
}
|
||||
(void) display; // Only used by the X11 driver
|
||||
if (param && *param)
|
||||
errx(1, "param %s", param);
|
||||
if (display && *display)
|
||||
errx(1, "display %s", display);
|
||||
|
||||
connection = display_connect_default();
|
||||
if (!connection && errno == ECONNREFUSED)
|
||||
display_spawn(g_argc, g_argv);
|
||||
return "TODO: display_spawn";
|
||||
|
||||
if (!connection) {
|
||||
char err[256];
|
||||
snprintf(err, sizeof(err), "Error connecting to display: %s\n", strerror(errno));
|
||||
return stracpy(err);
|
||||
}
|
||||
if (!connection)
|
||||
return "TODO: Proper error reporting";
|
||||
|
||||
sortix_driver.get_color = get_color_fn(sortix_driver.depth);
|
||||
|
||||
|
@ -155,6 +152,9 @@ static unsigned char *sortix_init_driver(unsigned char *param, unsigned char *di
|
|||
|
||||
static struct graphics_device *sortix_init_device(void)
|
||||
{
|
||||
if (current_dev)
|
||||
errx(1, "Attempting to create second window");
|
||||
|
||||
struct graphics_device *dev = mem_calloc(sizeof(struct graphics_device));
|
||||
|
||||
dev->size.x1 = 0;
|
||||
|
|
Loading…
Reference in New Issue