@ -248,7 +248,7 @@ void on_driver_selection_change(GtkWidget *self, widgets_dict *widgets){
target = module ;
target = module ;
else
else
target = package ;
target = package ;
if ( ! strcmp ( target , " xf86-video-intel " ) | | ! strcmp ( target , " lib32-vulkan-intel " ) | | ! strcmp ( target , " mesa " ) ) {
if ( yon_char_parsed_check_exist ( drivers_always_active , drivers_always_active_size , target ) > - 1 ) {
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversInstallButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 0 ) ;
gtk_widget_set_sensitive ( widgets - > driversDeleteButton , 0 ) ;
}
}
@ -1131,20 +1131,6 @@ dictionary *yon_proprieary_get(){
int size = 0 ;
int size = 0 ;
config_str drivers = NULL ;
config_str drivers = NULL ;
config_str rtn = NULL ;
config_str rtn = NULL ;
int adapter_size ;
char flag = 0 ;
config_str adapter = yon_config_load ( get_adapter_info , & adapter_size ) ;
for ( int i = 0 ; i < adapter_size ; i + + ) {
char * current_string = NULL ;
if ( strstr ( adapter [ i ] , " vendor= " ) ) {
if ( strstr ( adapter [ i ] , " Intel " ) )
flag | = ( 1 < < 0 ) ;
else if ( strstr ( adapter [ i ] , " AMD " ) | | strstr ( adapter [ i ] , " Advanced Micro Devices " ) )
flag | = ( 1 < < 1 ) ;
else if ( strstr ( adapter [ i ] , " NVIDIA " ) )
flag | = ( 1 < < 2 ) ;
}
}
rtn = yon_config_load ( get_proprietary_drivers_info_command , & size ) ;
rtn = yon_config_load ( get_proprietary_drivers_info_command , & size ) ;
if ( videoconfig . proprietary ) {
if ( videoconfig . proprietary ) {
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
yon_gtk_list_store_fill_with_proprietaries ( videoconfig . list ) ;
@ -1159,22 +1145,18 @@ dictionary *yon_proprieary_get(){
config_str current = yon_char_parse ( rtn [ di ] , & current_size , " ; " ) ;
config_str current = yon_char_parse ( rtn [ di ] , & current_size , " ; " ) ;
if ( current_size > 2 ) {
if ( current_size > 2 ) {
if ( strcmp ( current [ 0 ] , " " ) ) {
if ( strcmp ( current [ 0 ] , " " ) ) {
if ( ! ! strstr ( current [ 0 ] , " nvidia " ) & & ( ( flag > > 2 ) & 1 ) | | ! ! strstr ( current [ 0 ] , " amdgpu " ) & & ( ( flag > > 1 ) & 1 ) | | ( ! strcmp ( current [ 0 ] , " xf86-video-intel " ) | | ! strcmp ( current [ 0 ] , " mesa " ) ) & & ( ( flag > > 1 ) & 1 ) | | ! ! strstr ( current [ 0 ] , " lib32-vulkan-intel " ) & & ( ( flag > > 0 ) & 1 ) ) {
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 0 ] ) ;
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 0 ] ) ;
if ( target > - 1 ) {
if ( target > - 1 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
} else {
} else {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 0 ] , rtn [ di ] ) ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 0 ] , rtn [ di ] ) ;
}
}
}
} else if ( strcmp ( current [ 1 ] , " " ) ) {
} else if ( strcmp ( current [ 1 ] , " " ) ) {
if ( ! ! strstr ( current [ 1 ] , " nvidia " ) & & ( ( flag > > 2 ) & 1 ) | | ! ! strstr ( current [ 1 ] , " amdgpu " ) & & ( ( flag > > 1 ) & 1 ) | | ( ! strcmp ( current [ 1 ] , " xf86-video-intel " ) | | ! strcmp ( current [ 1 ] , " mesa " ) | | ! ! strstr ( current [ 1 ] , " lib32-vulkan-intel " ) ) & & ( ( flag > > 0 ) & 1 ) ) {
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 1 ] ) ;
int target = yon_char_parsed_check_exist ( drivers , drivers_size , current [ 1 ] ) ;
if ( target > - 1 ) {
if ( target > - 1 ) {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , drivers [ target ] , rtn [ di ] ) ;
} else {
} else {
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 1 ] , rtn [ di ] ) ;
yon_dictionary_add_or_create_if_exists_with_data ( videoconfig . proprietary , current [ 1 ] , rtn [ di ] ) ;
}
}
}
}
}
}
}
@ -1230,13 +1212,13 @@ void yon_gtk_list_store_fill_with_proprietaries(GtkListStore *list){
if ( strcmp ( str [ 0 ] , " " ) ! = 0 & & str [ 0 ] ) {
if ( strcmp ( str [ 0 ] , " " ) ! = 0 & & str [ 0 ] ) {
gtk_list_store_append ( videoconfig . list , & iter ) ;
gtk_list_store_append ( videoconfig . list , & iter ) ;
gtk_list_store_set ( videoconfig . list , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
gtk_list_store_set ( videoconfig . list , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 0 ] ) ! = - 1 )
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 0 ] ) ! = - 1 | | yon_char_parsed_check_exist ( drivers_always_active , drivers_always_active_size , str [ 1 ] ) > - 1 )
gtk_list_store_set ( videoconfig . list , & iter , 0 , 1 , - 1 ) ;
gtk_list_store_set ( videoconfig . list , & iter , 0 , 1 , - 1 ) ;
}
}
else {
else {
gtk_list_store_append ( videoconfig . list2 , & iter ) ;
gtk_list_store_append ( videoconfig . list2 , & iter ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 1 , str [ 0 ] , 2 , str [ 1 ] , 3 , str [ 2 ] , 4 , _ ( str [ 3 ] ) , 5 , _ ( str [ 4 ] ) , - 1 ) ;
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 1 ] ) ! = - 1 | | ! strcmp ( str [ 1 ] , " mesa " ) | | ! strcmp ( str [ 1 ] , " lib32-vulkan-intel " ) | | ! strcmp ( str [ 1 ] , " xf86-video-intel " ) ) {
if ( yon_char_parsed_check_exist ( installed , inssize , str [ 1 ] ) ! = - 1 | | yon_char_parsed_check_exist ( drivers_always_active , drivers_always_active_size , str [ 1 ] ) > - 1 ) {
gtk_list_store_set ( videoconfig . list2 , & iter , 0 , 1 , - 1 ) ;
gtk_list_store_set ( videoconfig . list2 , & iter , 0 , 1 , - 1 ) ;
}
}
}
}