mirror of
				https://git.yoctoproject.org/libmatchboxwm2
				synced 2025-11-04 21:25:44 +08:00 
			
		
		
		
	theme: don't determine use of compositing in theme
This removes the option of overriding the use of compositing in a theme.
This commit is contained in:
		@@ -468,12 +468,6 @@
 | 
				
			|||||||
          </para>
 | 
					          </para>
 | 
				
			||||||
	</listitem>
 | 
						</listitem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<listitem>
 | 
					 | 
				
			||||||
	  <para>compositing: whether composting should be enabled for this
 | 
					 | 
				
			||||||
	  theme; "yes" or "no", default "no".
 | 
					 | 
				
			||||||
          </para>
 | 
					 | 
				
			||||||
	</listitem>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	<listitem>
 | 
						<listitem>
 | 
				
			||||||
	  <para>shaped: whether this theme uses shaped windows; "yes" or
 | 
						  <para>shaped: whether this theme uses shaped windows; "yes" or
 | 
				
			||||||
	  "no", default "no" (only available for PNG themes; see the "client"
 | 
						  "no", default "no" (only available for PNG themes; see the "client"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2233,9 +2233,7 @@ _mb_wm_manager_start (MBWMManager * wm, MBWMCompMgr *compositor)
 | 
				
			|||||||
  if (compositor)
 | 
					  if (compositor)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      wm->comp_mgr = mb_wm_object_ref (MB_WM_OBJECT (compositor));
 | 
					      wm->comp_mgr = mb_wm_object_ref (MB_WM_OBJECT (compositor));
 | 
				
			||||||
 | 
					      mb_wm_manager_set_compositing_on (wm);
 | 
				
			||||||
      if (mb_wm_theme_use_compositing_mgr (wm->theme))
 | 
					 | 
				
			||||||
        mb_wm_manager_set_compositing_on (wm);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -137,9 +137,6 @@ mb_wm_theme_init (MBWMObject *obj, va_list vap)
 | 
				
			|||||||
	case MBWMObjectPropThemeShadowType:
 | 
						case MBWMObjectPropThemeShadowType:
 | 
				
			||||||
	  theme->shadow_type = va_arg(vap, int);
 | 
						  theme->shadow_type = va_arg(vap, int);
 | 
				
			||||||
	  break;
 | 
						  break;
 | 
				
			||||||
	case MBWMObjectPropThemeCompositing:
 | 
					 | 
				
			||||||
	  theme->compositing = va_arg(vap, int);
 | 
					 | 
				
			||||||
	  break;
 | 
					 | 
				
			||||||
	case MBWMObjectPropThemeShaped:
 | 
						case MBWMObjectPropThemeShaped:
 | 
				
			||||||
	  theme->shaped = va_arg(vap, int);
 | 
						  theme->shaped = va_arg(vap, int);
 | 
				
			||||||
	  break;
 | 
						  break;
 | 
				
			||||||
@@ -376,7 +373,6 @@ struct expat_data
 | 
				
			|||||||
  MBWMColor     color_lowlight;
 | 
					  MBWMColor     color_lowlight;
 | 
				
			||||||
  MBWMColor     color_shadow;
 | 
					  MBWMColor     color_shadow;
 | 
				
			||||||
  MBWMCompMgrShadowType shadow_type;
 | 
					  MBWMCompMgrShadowType shadow_type;
 | 
				
			||||||
  Bool          compositing;
 | 
					 | 
				
			||||||
  Bool          shaped;
 | 
					  Bool          shaped;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -394,7 +390,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
  MBWMColor      clr_lowlight;
 | 
					  MBWMColor      clr_lowlight;
 | 
				
			||||||
  MBWMColor      clr_shadow;
 | 
					  MBWMColor      clr_shadow;
 | 
				
			||||||
  MBWMCompMgrShadowType shadow_type;
 | 
					  MBWMCompMgrShadowType shadow_type;
 | 
				
			||||||
  Bool           compositing;
 | 
					 | 
				
			||||||
  Bool           shaped;
 | 
					  Bool           shaped;
 | 
				
			||||||
  struct stat    st;
 | 
					  struct stat    st;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -458,7 +453,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      memset (&udata, 0, sizeof (struct expat_data));
 | 
					      memset (&udata, 0, sizeof (struct expat_data));
 | 
				
			||||||
      udata.compositing = True;
 | 
					 | 
				
			||||||
      udata.par         = par;
 | 
					      udata.par         = par;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      XML_SetElementHandler (par,
 | 
					      XML_SetElementHandler (par,
 | 
				
			||||||
@@ -527,7 +521,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
      clr_shadow.set = udata.color_shadow.set;
 | 
					      clr_shadow.set = udata.color_shadow.set;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      shadow_type = udata.shadow_type;
 | 
					      shadow_type = udata.shadow_type;
 | 
				
			||||||
      compositing = udata.compositing;
 | 
					 | 
				
			||||||
      shaped      = udata.shaped;
 | 
					      shaped      = udata.shaped;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      xml_stack_free (udata.stack);
 | 
					      xml_stack_free (udata.stack);
 | 
				
			||||||
@@ -544,7 +537,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
			MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
								MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
				
			||||||
			MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
								MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
				
			||||||
			MBWMObjectPropThemeShadowType,     shadow_type,
 | 
								MBWMObjectPropThemeShadowType,     shadow_type,
 | 
				
			||||||
			MBWMObjectPropThemeCompositing,    compositing,
 | 
					 | 
				
			||||||
			MBWMObjectPropThemeShaped,         shaped,
 | 
								MBWMObjectPropThemeShaped,         shaped,
 | 
				
			||||||
			NULL);
 | 
								NULL);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -559,7 +551,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
			MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
								MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
				
			||||||
			MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
								MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
				
			||||||
			MBWMObjectPropThemeShadowType,     shadow_type,
 | 
								MBWMObjectPropThemeShadowType,     shadow_type,
 | 
				
			||||||
			MBWMObjectPropThemeCompositing,    compositing,
 | 
					 | 
				
			||||||
			MBWMObjectPropThemeShaped,         shaped,
 | 
								MBWMObjectPropThemeShaped,         shaped,
 | 
				
			||||||
			NULL));
 | 
								NULL));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -575,7 +566,6 @@ mb_wm_theme_new (MBWMManager * wm, const char * theme_path)
 | 
				
			|||||||
			MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
								MBWMObjectPropThemeColorLowlight, &clr_lowlight,
 | 
				
			||||||
			MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
								MBWMObjectPropThemeColorShadow,   &clr_shadow,
 | 
				
			||||||
			MBWMObjectPropThemeShadowType,     shadow_type,
 | 
								MBWMObjectPropThemeShadowType,     shadow_type,
 | 
				
			||||||
			MBWMObjectPropThemeCompositing,    compositing,
 | 
					 | 
				
			||||||
			MBWMObjectPropThemeShaped,         shaped,
 | 
								MBWMObjectPropThemeShaped,         shaped,
 | 
				
			||||||
			NULL));
 | 
								NULL));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -794,15 +784,6 @@ mb_wm_theme_get_shadow_type (MBWMTheme * theme)
 | 
				
			|||||||
  return theme->shadow_type;
 | 
					  return theme->shadow_type;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool
 | 
					 | 
				
			||||||
mb_wm_theme_use_compositing_mgr (MBWMTheme * theme)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  if (!theme)
 | 
					 | 
				
			||||||
    return False;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return theme->compositing;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Expat callback stuff
 | 
					 * Expat callback stuff
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -935,13 +916,6 @@ xml_element_start_cb (void *data, const char *tag, const char **expat_attr)
 | 
				
			|||||||
	      else if (!strcmp (*(p+1), "gaussian"))
 | 
						      else if (!strcmp (*(p+1), "gaussian"))
 | 
				
			||||||
		exd->shadow_type = MBWM_COMP_MGR_SHADOW_GAUSSIAN;
 | 
							exd->shadow_type = MBWM_COMP_MGR_SHADOW_GAUSSIAN;
 | 
				
			||||||
	    }
 | 
						    }
 | 
				
			||||||
	  else if (!strcmp (*p, "compositing"))
 | 
					 | 
				
			||||||
	    {
 | 
					 | 
				
			||||||
	      if (!strcmp (*(p+1), "yes") || !strcmp (*(p+1), "1"))
 | 
					 | 
				
			||||||
		exd->compositing = True;
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
		exd->compositing = False;
 | 
					 | 
				
			||||||
	    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  p += 2;
 | 
						  p += 2;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,6 @@ struct MBWMTheme
 | 
				
			|||||||
  char                  *path;
 | 
					  char                  *path;
 | 
				
			||||||
  GList              *xml_clients;
 | 
					  GList              *xml_clients;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Bool                   compositing;
 | 
					 | 
				
			||||||
  Bool                   shaped;
 | 
					  Bool                   shaped;
 | 
				
			||||||
  MBWMColor              color_lowlight;
 | 
					  MBWMColor              color_lowlight;
 | 
				
			||||||
  MBWMColor              color_shadow;
 | 
					  MBWMColor              color_shadow;
 | 
				
			||||||
@@ -188,9 +187,6 @@ mb_wm_theme_get_shadow_color (MBWMTheme             * theme,
 | 
				
			|||||||
MBWMCompMgrShadowType
 | 
					MBWMCompMgrShadowType
 | 
				
			||||||
mb_wm_theme_get_shadow_type (MBWMTheme * theme);
 | 
					mb_wm_theme_get_shadow_type (MBWMTheme * theme);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool
 | 
					 | 
				
			||||||
mb_wm_theme_use_compositing_mgr (MBWMTheme * theme);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef unsigned int (*MBWMThemeCustomClientTypeFunc) (const char *type_name,
 | 
					typedef unsigned int (*MBWMThemeCustomClientTypeFunc) (const char *type_name,
 | 
				
			||||||
						       void       *user_data);
 | 
											       void       *user_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user