Hi all,
find attached three patches. Two for the e's randr subsystem and one
for the website.
e_randr:
The first patch prevents a segv when the monitor has no preferred
mode. I just went streight forward and set the first mode (in the list
of modes) to be the only preferred mode in such a case.
The second patch adds some information to the subsystem's information
structure. This data is important for the configuration dialog I'm
working on.
Website:
Currently we use a bad search string with google as it searches the
entire website instead of just the docs domain as the search page
suggests. If people like it would be easy to integrate the search
results into e.g. a dynamic iframe on the docs page so users can stay
on e.org while searching the docs.
BR,
Leif
From 7215a1a5b18428e49475b53b6043e851b0dbd2b5 Mon Sep 17 00:00:00 2001
From: Leif Middelschulte <[email protected]>
Date: Wed, 16 Mar 2011 13:35:56 +0100
Subject: [PATCH 1/4] Small fixes (possible segv) in e's randr subsystem
-Assume the first mode of the list to be preferred.
-Preprend modes to the list of modes as we decrement the iterator
-Add a catch if a monitor has 0 modes and therefore can't be enabled
automatically (the risk is too high).
---
trunk/e/src/bin/e_randr.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/trunk/e/src/bin/e_randr.c b/trunk/e/src/bin/e_randr.c
index bfbb348..53ee9b6 100644
--- a/trunk/e/src/bin/e_randr.c
+++ b/trunk/e/src/bin/e_randr.c
@@ -548,6 +548,9 @@ _e_randr_output_modes_add(E_Randr_Output_Info *output_info)
if (E_RANDR_NO_12 || !(modes = ecore_x_randr_output_modes_get(e_randr_screen_info->root, output_info->xid, &nmodes, &npreferred))) return EINA_FALSE;
+ //In case the monitor does not have any preferred mode at all
+ if (nmodes > 0 && npreferred == 0) npreferred = 1;
+
while (--nmodes >= 0)
{
added_yet = EINA_FALSE;
@@ -562,10 +565,10 @@ _e_randr_output_modes_add(E_Randr_Output_Info *output_info)
if(!added_yet)
{
mode_info = ecore_x_randr_mode_info_get(e_randr_screen_info->root, modes[nmodes]);
- e_randr_screen_info->rrvd_info.randr_info_12->modes = eina_list_append(e_randr_screen_info->rrvd_info.randr_info_12->modes, mode_info);
+ e_randr_screen_info->rrvd_info.randr_info_12->modes = eina_list_prepend(e_randr_screen_info->rrvd_info.randr_info_12->modes, mode_info);
}
- output_info->modes = eina_list_append(output_info->modes, mode_info);
- if (nmodes < npreferred) output_info->preferred_modes = eina_list_append(output_info->preferred_modes, mode_info);
+ output_info->modes = eina_list_prepend(output_info->modes, mode_info);
+ if (nmodes < npreferred) output_info->preferred_modes = eina_list_prepend(output_info->preferred_modes, mode_info);
}
@@ -1282,7 +1285,12 @@ _e_randr_try_enable_output(E_Randr_Output_Info *output_info, Eina_Bool force)
if ((usable_crtc && (!usable_crtc->current_mode)) || force)
{
//enable and position according to used policies
- mode_info = ((Ecore_X_Randr_Mode_Info*)eina_list_nth(output_info->preferred_modes, 0));
+ if(!(mode_info = ((Ecore_X_Randr_Mode_Info*)eina_list_nth(output_info->preferred_modes, 0))))
+ {
+ fprintf(stderr, "E_RANDR: Could not enable output(%d), as it has no preferred (and there for none at all) modes.!\n", output_info->xid);
+ ret = EINA_FALSE;
+ break;
+ }
if((ret = ecore_x_randr_crtc_mode_set(e_randr_screen_info->root, usable_crtc->xid, &output_info->xid, 1, mode_info->xid)))
{
usable_crtc->geometry.w = mode_info->width;
--
1.7.1
From 841e4ad8ad76b62fc28ca03d9ab1106c66915cca Mon Sep 17 00:00:00 2001
From: Leif Middelschulte <[email protected]>
Date: Sat, 12 Mar 2011 14:13:23 +0100
Subject: [PATCH 2/4] Add 'common modes' to CRTC information structure.
---
trunk/e/src/bin/e_randr.c | 11 ++++++-----
trunk/e/src/bin/e_randr.h | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/trunk/e/src/bin/e_randr.c b/trunk/e/src/bin/e_randr.c
index 53ee9b6..e8c7757 100644
--- a/trunk/e/src/bin/e_randr.c
+++ b/trunk/e/src/bin/e_randr.c
@@ -531,6 +531,7 @@ _e_randr_crtc_info_set(E_Randr_Crtc_Info *crtc_info)
if (crtc_info->current_mode)
fprintf(stderr, "found CRTC %d in mode %d\n", crtc_info->xid, crtc_info->current_mode->xid);
crtc_info->current_orientation = ecore_x_randr_crtc_orientation_get(e_randr_screen_info->root, crtc_info->xid);
+ crtc_info->outputs_common_modes = _e_randr_outputs_common_modes_get(crtc_info->outputs, NULL);
}
/*
@@ -1523,20 +1524,20 @@ static Eina_Bool
_e_randr_crtc_outputs_mode_max_set(E_Randr_Crtc_Info *crtc_info)
{
Ecore_X_Randr_Mode_Info *mode_info;
- Eina_List *common_modes, *iter;
+ Eina_List *iter;
Eina_Bool ret = EINA_TRUE;
Ecore_X_Randr_Output *outputs;
- if (!crtc_info || !crtc_info->outputs || !(common_modes = _e_randr_outputs_common_modes_get(crtc_info->outputs, NULL))) return EINA_FALSE;
+ if (!crtc_info || !crtc_info->outputs || !crtc_info->outputs_common_modes) return EINA_FALSE;
- EINA_LIST_REVERSE_FOREACH(common_modes, iter, mode_info)
+ EINA_LIST_REVERSE_FOREACH(crtc_info->outputs_common_modes, iter, mode_info)
{
if (!_e_randr_crtc_mode_intersects_crtcs(crtc_info, mode_info))
break;
}
if (!mode_info)
{
- eina_list_free(common_modes);
+ eina_list_free(crtc_info->outputs_common_modes);
return EINA_FALSE;
}
if ((outputs = _e_randr_outputs_to_array(crtc_info->outputs)))
@@ -1544,7 +1545,7 @@ _e_randr_crtc_outputs_mode_max_set(E_Randr_Crtc_Info *crtc_info)
ret = ecore_x_randr_crtc_mode_set(e_randr_screen_info->root, crtc_info->xid, outputs, eina_list_count(crtc_info->outputs), mode_info->xid);
free(outputs);
}
- eina_list_free(common_modes);
+ eina_list_free(crtc_info->outputs_common_modes);
ecore_x_randr_screen_reset(e_randr_screen_info->root);
diff --git a/trunk/e/src/bin/e_randr.h b/trunk/e/src/bin/e_randr.h
index 331fa11..448fc89 100644
--- a/trunk/e/src/bin/e_randr.h
+++ b/trunk/e/src/bin/e_randr.h
@@ -31,6 +31,7 @@ struct _E_Randr_Crtc_Info
int gamma_ramp_size;
Eina_List *outputs;
Eina_List *possible_outputs;
+ Eina_List *outputs_common_modes;
Ecore_X_Randr_Mode_Info *current_mode;
};
--
1.7.1
From 64f4904908281cba20b57e530708e748a28d2cce Mon Sep 17 00:00:00 2001
From: Leif Middelschulte <[email protected]>
Date: Wed, 16 Mar 2011 23:53:28 +0100
Subject: [PATCH 3/4] Improve query for docs search functionality.
---
trunk/web/www/p/docs/en-body | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/trunk/web/www/p/docs/en-body b/trunk/web/www/p/docs/en-body
index 5025567..23e77ad 100644
--- a/trunk/web/www/p/docs/en-body
+++ b/trunk/web/www/p/docs/en-body
@@ -12,7 +12,7 @@
<td align=center><input type="submit" value="Search" style="width:120px"></td>
</tr>
</table>
-<input type=hidden name="sitesearch" value="enlightenment.org">
+<input type=hidden name="sitesearch" value="docs.enlightenment.org/auto">
</form>
</p></center>
--
1.7.1
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel