Index: uspace/app/gfxdemo/gfxdemo.c
===================================================================
--- uspace/app/gfxdemo/gfxdemo.c	(revision 4c2339bf9d088384ba7f50db4244269c09e6e185)
+++ uspace/app/gfxdemo/gfxdemo.c	(revision 3d588becf95d128a09fc35cb7d9360abe025be9e)
@@ -78,16 +78,14 @@
 static gfx_coord_t vpad;
 static console_ctrl_t *con = NULL;
+static bool textmode;
 static ui_t *ui;
 
 /** Determine if we are running in text mode.
  *
- * @param w Screen width
- * @param h Screen height
  * @return @c true iff we are running in text mode
  */
-static bool demo_is_text(gfx_coord_t w, gfx_coord_t h)
-{
-	// XXX Need a proper way to determine text mode
-	return w <= 80;
+static bool demo_is_text(void)
+{
+	return textmode;
 }
 
@@ -181,5 +179,5 @@
 
 	/* XXX Crude way of detecting text mode */
-	if (w < 256) {
+	if (demo_is_text()) {
 		/* Create dummy font for text mode */
 		rc = gfx_typeface_create(gc, &tface);
@@ -270,5 +268,5 @@
 
 	if (font != NULL) {
-		if (demo_is_text(w, h)) {
+		if (demo_is_text()) {
 			rc = gfx_color_new_ega(0x1e, &color);
 			if (rc != EOK)
@@ -719,5 +717,5 @@
 	gfx_color_delete(color);
 
-	if (demo_is_text(w, h)) {
+	if (demo_is_text()) {
 		rc = gfx_color_new_ega(0x1f, &color);
 		if (rc != EOK)
@@ -807,5 +805,5 @@
 
 	for (i = 0; i < 8; i++) {
-		if (demo_is_text(w, h)) {
+		if (demo_is_text()) {
 			rc = gfx_color_new_ega(i != 0 ? i : 0x10, &color);
 			if (rc != EOK)
@@ -884,5 +882,5 @@
 		gfx_color_delete(color);
 
-		if (demo_is_text(w, h)) {
+		if (demo_is_text()) {
 			rc = gfx_color_new_ega(0x1f, &color);
 			if (rc != EOK)
@@ -1093,4 +1091,7 @@
 
 	gc = console_gc_get_ctx(cgc);
+
+	/* Currently console is always text. */
+	textmode = true;
 
 	rc = demo_loop(gc, cols, rows);
@@ -1192,4 +1193,6 @@
 		task_retval(0);
 
+	textmode = ui_is_textmode(ui);
+
 	args.gc = gc;
 	args.dims = dims;
@@ -1252,4 +1255,7 @@
 
 	task_retval(0);
+
+	/* FIXME Assuming display service is not text mode. */
+	textmode = false;
 
 	rc = demo_loop(gc, 400, 300);
