This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch modules/convertible
in repository enlightenment.
View the commit online.
commit 4a9923b927092d11502f5b28fe804532c244cb7f
Author: rafspiny <rafsp...@gmail.com>
AuthorDate: Mon Dec 18 20:55:55 2023 +0100
Skip rotation on undefined orientation.
Empty
More logs
---
src/modules/convertible/dbus_acceleration.c | 25 +++++++++++++++++++++----
src/modules/convertible/e_mod_main.c | 13 ++++++++++++-
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/modules/convertible/dbus_acceleration.c b/src/modules/convertible/dbus_acceleration.c
index 62c5669d3..c2e234b3c 100644
--- a/src/modules/convertible/dbus_acceleration.c
+++ b/src/modules/convertible/dbus_acceleration.c
@@ -166,6 +166,9 @@ enum screen_rotation access_string_property(const Eldbus_Message *msg, Eina_Bool
if (strcmp(ACCELEROMETER_ORIENTATION_NORMAL, *string_property_value) == 0)
rotation = normal;
+ if (strcmp(ACCELEROMETER_ORIENTATION_UNDEFINED, *string_property_value) == 0)
+ *result = EINA_FALSE;
+
free((void *) type);
free(string_property_value);
return rotation;
@@ -280,6 +283,7 @@ on_accelerometer_orientation(void *data, const Eldbus_Message *msg, Eldbus_Pendi
int _convertible_rotation_get(const enum screen_rotation orientation)
{
+ DBG("Inside _convertible_rotation_get with orientation %d", orientation);
switch (orientation)
{
case normal: return 0;
@@ -377,17 +381,30 @@ void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orienta
DBG("Passed Orientation: %d", orientation);
DBG("Working on screen %s", randr_id);
E_Randr2_Screen *rotatable_screen = e_randr2_screen_id_find(randr_id);
+ if (rotatable_screen == NULL)
+ {
+ DBG("Failed to load screen for id %s", randr_id);
+ return;
+ }
DBG("Obtained screen obj for %s", randr_id);
+ DBG("Screen obj %s", rotatable_screen->id);
+
E_Config_Randr2_Screen *screen_randr_cfg = e_randr2_config_screen_find(rotatable_screen, e_randr2_cfg);
+ if (screen_randr_cfg == NULL)
+ {
+ DBG("Failed to load screen configuration for id %s", randr_id);
+ return;
+ }
DBG("Obtained Randr2_screen cfg for %s", randr_id);
+ DBG("Screen configuration obj %s is enalbed %d", screen_randr_cfg->id, screen_randr_cfg->enabled);
int rotation = _convertible_rotation_get(orientation);
- DBG("Screen %s is going to be rotated from %d to %d", randr_id, screen_randr_cfg->rotation, rotation);
+ DBG("Screen %s is going to be rotated to %d", randr_id, rotation);
- if (rotation == screen_randr_cfg->rotation)
+ /*if (rotation == screen_randr_cfg->rotation)
{
WARN("Screen %s is already rotated to %d degrees", randr_id, rotation);
} else
- {
+ {*/
screen_randr_cfg->rotation = rotation;
e_randr2_config_apply();
DBG("Screen %s rotated to %d", randr_id, rotation);
@@ -423,7 +440,7 @@ void _fetch_and_rotate_screen(const char* randr_id, enum screen_rotation orienta
}
free(result);
free(matrix);
- }
+ //}
}
void
diff --git a/src/modules/convertible/e_mod_main.c b/src/modules/convertible/e_mod_main.c
index 67b2b4a78..daec2914f 100644
--- a/src/modules/convertible/e_mod_main.c
+++ b/src/modules/convertible/e_mod_main.c
@@ -302,10 +302,21 @@ e_modapi_init(E_Module *m)
E_Randr2_Screen *screen = e_randr2_screen_id_find(zone->randr2_id);
DBG("name randr2 id %s", zone->randr2_id);
DBG("rot_90 %i", screen->info.can_rot_90);
+
+ FILE* filePointer;
+ filePointer = fopen("/home/raffaele/screens.txt", "a");
+ if (filePointer == NULL) {
+ printf("GfgTest.c file failed to open.");
+ }
+ else {
+ fprintf(filePointer,"randr2 id %s\n", zone->randr2_id);
+ fprintf(filePointer,"randr2 rot_90 capacity %d\n", screen->info.can_rot_90);
+ fclose(filePointer);
+ }
// Arbitrarily chosen a condition to check that rotation is enabled
if (screen->info.can_rot_90 == EINA_TRUE)
{
- int max_screen_length = 400;
+ int max_screen_length = 700;
char *randr2_id = malloc(sizeof(char) * max_screen_length);
int copied_chars = eina_strlcpy(randr2_id, zone->randr2_id, max_screen_length);
if (copied_chars > max_screen_length)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.