-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for manually setting subpixel hinting on outputs.
Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses #3163
- Loading branch information
Showing
14 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <string.h> | ||
#include "log.h" | ||
#include "sway/commands.h" | ||
#include "sway/config.h" | ||
#include "sway/output.h" | ||
|
||
struct cmd_results *output_cmd_subpixel(int argc, char **argv) { | ||
if (!config->handler_context.output_config) { | ||
return cmd_results_new(CMD_FAILURE, "Missing output config"); | ||
} | ||
if (!argc) { | ||
return cmd_results_new(CMD_INVALID, "Missing subpixel argument."); | ||
} | ||
enum wl_output_subpixel subpixel; | ||
|
||
if (strcmp(*argv, "rgb") == 0) { | ||
subpixel = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; | ||
} else if (strcmp(*argv, "bgr") == 0) { | ||
subpixel = WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; | ||
} else if (strcmp(*argv, "vrgb") == 0) { | ||
subpixel = WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; | ||
} else if (strcmp(*argv, "vbgr") == 0) { | ||
subpixel = WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; | ||
} else if (strcmp(*argv, "none") == 0) { | ||
subpixel = WL_OUTPUT_SUBPIXEL_NONE; | ||
} else { | ||
return cmd_results_new(CMD_INVALID, "Invalid output subpixel."); | ||
} | ||
|
||
struct output_config *oc = config->handler_context.output_config; | ||
config->handler_context.leftovers.argc = argc - 1; | ||
config->handler_context.leftovers.argv = argv + 1; | ||
|
||
oc->subpixel = subpixel; | ||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters