Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
610 B

  1. void
  2. sortscreens(XineramaScreenInfo *screens, int n)
  3. {
  4. int i, j;
  5. XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo));
  6. for (i = 0; i < n; i++)
  7. for (j = i + 1; j < n; j++)
  8. if (RIGHTOF(screens[i], screens[j])) {
  9. memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo));
  10. memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo));
  11. memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo));
  12. }
  13. XFree(screen);
  14. }