Skip to content

Commit

Permalink
check-accelerated: export renderer string also for llvmpipe
Browse files Browse the repository at this point in the history
Since the renderer string is now used to display the graphics label in
gnome-control-center, we need to make sure it gets set even if software
rendering is in use, else we wind up showing an empty string to the
user.

https://bugzilla.gnome.org/show_bug.cgi?id=768292
  • Loading branch information
mcatanzaro committed Jul 1, 2016
1 parent 4bc7406 commit 51d1e18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
8 changes: 1 addition & 7 deletions tools/gnome-session-check-accelerated-gl-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,7 @@ main (int argc, char **argv)
goto out;
}

if (has_llvmpipe) {
_print_error ("llvmpipe detected.");
ret = HELPER_SOFTWARE_RENDERING;
goto out;
}

ret = HELPER_ACCEL;
ret = has_llvmpipe ? HELPER_SOFTWARE_RENDERING : HELPER_ACCEL;

if (print_renderer)
g_print ("%s", renderer);
Expand Down
20 changes: 11 additions & 9 deletions tools/gnome-session-check-accelerated.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ main (int argc, char **argv)
NULL, NULL, &renderer_string, NULL, &estatus, &gl_error)) {
is_accelerated = (WEXITSTATUS(estatus) == HELPER_ACCEL) || (WEXITSTATUS(estatus) == HELPER_SOFTWARE_RENDERING);
is_software_rendering = (WEXITSTATUS(estatus) == HELPER_SOFTWARE_RENDERING);
if (is_accelerated)
if (is_accelerated || is_software_rendering)
goto finish;

g_clear_pointer (&renderer_string, g_free);
Expand Down Expand Up @@ -217,14 +217,6 @@ main (int argc, char **argv)
rootwin,
is_accelerated_atom,
XA_CARDINAL, 32, PropModeReplace, (guchar *) &is_accelerated, 1);

XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
rootwin,
renderer_atom,
XA_STRING, 8, PropModeReplace, (guchar *) renderer_string, strlen (renderer_string));

/* Print the renderer */
g_print ("%s", renderer_string);
}

if (is_software_rendering) {
Expand All @@ -234,6 +226,16 @@ main (int argc, char **argv)
XA_CARDINAL, 32, PropModeReplace, (guchar *) &is_software_rendering, 1);
}

if (is_accelerated || is_software_rendering) {
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
rootwin,
renderer_atom,
XA_STRING, 8, PropModeReplace, (guchar *) renderer_string, strlen (renderer_string));

/* Print the renderer */
g_print ("%s", renderer_string);
}

gdk_display_sync (display);

return is_accelerated ? 0 : 1;
Expand Down

0 comments on commit 51d1e18

Please sign in to comment.