]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
terminal: refresh geometry after drm device arrives
authorRay Strode <rstrode@redhat.com>
Mon, 20 Jun 2016 17:45:37 +0000 (13:45 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 20 Jun 2016 17:45:37 +0000 (13:45 -0400)
It's quite likely that afer the drm device arrives, the number
of rows and columns in the terminal will change.

This commit makes sure to refresh the terminal state.

src/libply-splash-core/ply-device-manager.c
src/libply-splash-core/ply-terminal.c
src/libply-splash-core/ply-terminal.h

index 2ff03517bc3658d3dc73f28a2d3879d80993f968..7635780346200dc38ad3d874db2b7dea6c49ddac 100644 (file)
@@ -691,6 +691,9 @@ create_devices_for_terminal_and_renderer_type (ply_device_manager_t *manager,
                         ply_trace ("activating renderer");
                         ply_renderer_activate (renderer);
                 }
+
+                if (terminal != NULL)
+                        ply_terminal_refresh_geometry (terminal);
         } else if (terminal != NULL) {
                 keyboard = ply_keyboard_new_for_terminal (terminal);
                 ply_list_append_data (manager->keyboards, keyboard);
index 602ff49f3d16e2c68188c0d6ef949d22dd94f458..a0954f216e0c68e8dbf690249df00ef89894e83c 100644 (file)
@@ -387,8 +387,8 @@ on_tty_disconnected (ply_terminal_t *terminal)
         ply_terminal_reopen_device (terminal);
 }
 
-static bool
-ply_terminal_look_up_geometry (ply_terminal_t *terminal)
+bool
+ply_terminal_refresh_geometry (ply_terminal_t *terminal)
 {
         struct winsize terminal_size;
 
@@ -607,7 +607,7 @@ ply_terminal_open (ply_terminal_t *terminal)
                 return false;
         }
 
-        ply_terminal_look_up_geometry (terminal);
+        ply_terminal_refresh_geometry (terminal);
 
         ply_terminal_look_up_color_palette (terminal);
         ply_terminal_save_color_palette (terminal);
@@ -615,7 +615,7 @@ ply_terminal_open (ply_terminal_t *terminal)
         ply_event_loop_watch_signal (terminal->loop,
                                      SIGWINCH,
                                      (ply_event_handler_t)
-                                     ply_terminal_look_up_geometry,
+                                     ply_terminal_refresh_geometry,
                                      terminal);
 
         if (ply_terminal_is_vt (terminal)) {
index dc83ec32f9ff60a35a443f0e28c50ad640f0b5a3..7cfcc597a9e8b31430e5a97c995166b8d6e95302 100644 (file)
@@ -69,6 +69,7 @@ void ply_terminal_reset_colors (ply_terminal_t *terminal);
 
 bool ply_terminal_set_unbuffered_input (ply_terminal_t *terminal);
 bool ply_terminal_set_buffered_input (ply_terminal_t *terminal);
+bool ply_terminal_refresh_geometry (ply_terminal_t *terminal);
 
 __attribute__((__format__ (__printf__, 2, 3)))
 void ply_terminal_write (ply_terminal_t *terminal,