]> Dogcows Code - chaz/openbox/commitdiff
Merge branch 'master' into chaz
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 26 Oct 2012 19:03:24 +0000 (13:03 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Fri, 26 Oct 2012 19:03:24 +0000 (13:03 -0600)
Conflicts:
openbox/config.c

configure.ac
data/rc.xml
data/rc.xsd
openbox/client.c
openbox/client.h
openbox/config.c
openbox/config.h
openbox/frame.c
openbox/moveresize.c
openbox/session.c
openbox/session.h

index a18330907ad6b61609d3742d5b08655a303556b6..dfdcf057c869a9cbfcc99318df055a035b6d38db 100644 (file)
@@ -3,7 +3,6 @@ AC_INIT([openbox], [3.5.0], [http://bugzilla.icculus.org])
 AC_CONFIG_SRCDIR([openbox/openbox.c])
 
 AM_INIT_AUTOMAKE([foreign])
-AM_SILENT_RULES([yes])
 
 OB_VERSION=$PACKAGE_VERSION
 AC_SUBST(OB_VERSION)
index 932521b7095dfe6603d4dc6addb1e8a65d38e643..ce1e8fc1f8d0775f323c1cef3231ae2d9d2cb789 100644 (file)
@@ -60,6 +60,8 @@
   -->
   <keepBorder>yes</keepBorder>
   <animateIconify>yes</animateIconify>
+  <flashFrameDelay>600</flashFrameDelay>
+  <flashFrameDuration>5000</flashFrameDuration>
   <font place="ActiveWindow">
     <name>sans</name>
     <size>8</size>
 
     <maximized>true</maximized>
     # 'Horizontal', 'Vertical' or boolean (yes/no)
+
+    <opacity>255</opacity>
+    # make the window semi-transparent
+    # value between 0 and 255, inclusive; 0 invisible, 255 fully opaque
   </application>
 
   # end of the example
index 425d53c9fd3fd6e2f4abaaa10df1cc5aa98ba7d3..0fd98ffb87c01c0df645f813c5b772ad5ee48699 100644 (file)
@@ -91,6 +91,8 @@
             <xsd:element minOccurs="0" name="titleLayout" type="xsd:string"/>
             <xsd:element minOccurs="0" name="keepBorder" type="ob:bool"/>
             <xsd:element minOccurs="0" name="animateIconify" type="ob:bool"/>
+            <xsd:element minOccurs="0" name="flashFrameDelay" type="ob:integer"/>
+            <xsd:element minOccurs="0" name="flashFrameDuration" type="ob:integer"/>
             <xsd:element minOccurs="0" maxOccurs="unbounded" name="font" type="ob:font"/>
         </xsd:sequence>
     </xsd:complexType>
             <xsd:element minOccurs="0" name="skip_taskbar" type="ob:bool"/>
             <xsd:element minOccurs="0" name="fullscreen" type="ob:bool"/>
             <xsd:element minOccurs="0" name="maximized" type="ob:maximization"/>
+            <xsd:element minOccurs="0" name="opacity" type="xsd:unsignedByte"/>
         </xsd:all>
         <!-- at least one of these must be present -->
         <xsd:attribute name="role" type="xsd:string"/>
index b6cc4a879300fa824f0d6c8be694829e023a8bc4..1478d840f832265471d208fac1fead0b3199ec64 100644 (file)
@@ -985,6 +985,9 @@ static ObAppSettings *client_get_settings_state(ObClient *self)
             self->desktop = settings->desktop - 1;
     }
 
+    if (settings->opacity != -1)
+       self->opacity = settings->opacity;
+
     if (settings->layer == -1) {
         self->below = TRUE;
         self->above = FALSE;
@@ -1043,6 +1046,8 @@ static void client_restore_session_state(ObClient *self)
     self->max_horz = self->session->max_horz;
     self->max_vert = self->session->max_vert;
     self->undecorated = self->session->undecorated;
+
+    self->opacity = self->session->opacity;
 }
 
 static gboolean client_restore_session_stacking(ObClient *self)
@@ -2842,6 +2847,7 @@ static void client_apply_startup_state(ObClient *self,
     gboolean demands_attention = self->demands_attention;
     gboolean max_horz = self->max_horz;
     gboolean max_vert = self->max_vert;
+    guint8   opacity = self->opacity;
     Rect oldarea;
     gint l;
 
@@ -2891,6 +2897,9 @@ static void client_apply_startup_state(ObClient *self,
     /* make sure client_setup_decor_and_functions() is called at least once */
     client_setup_decor_and_functions(self, FALSE);
 
+    /* make the client semi-transparent */
+    client_set_opacity(self, opacity);
+
     /* if the window hasn't been configured yet, then do so now, in fact the
        x,y,w,h may _not_ be the same as the area rect, which can end up
        meaning that the client isn't properly moved/resized by the fullscreen
@@ -3779,6 +3788,12 @@ void client_set_desktop(ObClient *self, guint target,
     focus_cycle_addremove(NULL, TRUE);
 }
 
+void client_set_opacity(ObClient *self, guint8 opacity)
+{
+    OBT_PROP_SET32(self->window, NET_WM_WINDOW_OPACITY, CARDINAL, 
+           opacity * 16777216);
+}
+
 gboolean client_is_direct_child(ObClient *parent, ObClient *child)
 {
     while (child != parent && (child = client_direct_parent(child)));
index d68d3035a3b20e54921bc6e5b4cb2f0295391f0c..a946f274bc906a19cab39ca66dfa7f8251eb3de3 100644 (file)
@@ -268,6 +268,8 @@ struct _ObClient
     gboolean max_vert;
     /*! The window is maximized to fill the screen horizontally */
     gboolean max_horz;
+    /*! The window is semi-transparent */
+    guint8 opacity;
     /*! The window should not be displayed by pagers */
     gboolean skip_pager;
     /*! The window should not be displayed by taskbars */
@@ -548,6 +550,9 @@ void client_kill(ObClient *self);
 void client_set_desktop(ObClient *self, guint target, gboolean donthide,
                         gboolean dontraise);
 
+/*! Adjust the client opacity */
+void client_set_opacity(ObClient *self, guint8 opacity);
+
 /*! Show the client if it should be shown. Returns if the window is shown. */
 gboolean client_show(ObClient *self);
 
index 03fc96b35bafc937f8fef9e4caf7411af1f03a7a..c21b47d88554162d189ebc6f2ff66c0ba90265c0 100644 (file)
@@ -47,6 +47,8 @@ StrutPartial config_margins;
 gchar   *config_theme;
 gboolean config_theme_keepborder;
 guint    config_theme_window_list_icon_size;
+guint    config_frame_flash_delay;
+guint    config_frame_flash_duration;
 
 gchar   *config_title_layout;
 
@@ -121,6 +123,7 @@ ObAppSettings* config_create_app_settings(void)
     settings->fullscreen = -1;
     settings->max_horz = -1;
     settings->max_vert = -1;
+    settings->opacity = -1;
     return settings;
 }
 
@@ -146,6 +149,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src,
     copy_if(fullscreen, -1);
     copy_if(max_horz, -1);
     copy_if(max_vert, -1);
+    copy_if(opacity, -1);
 
     if (src->pos_given) {
         dst->pos_given = TRUE;
@@ -343,6 +347,10 @@ static void parse_single_per_app_settings(xmlNodePtr app,
             g_free(s);
         }
     }
+
+    if ((n = obt_xml_find_node(app->children, "opacity")))
+        if (!obt_xml_node_contains(n, "default"))
+            settings->opacity = obt_xml_node_int(n);
 }
 
 /* Manages settings for individual applications.
@@ -699,6 +707,10 @@ static void parse_theme(xmlNodePtr node, gpointer d)
         else if (config_theme_window_list_icon_size > 96)
             config_theme_window_list_icon_size = 96;
     }
+    if ((n = obt_xml_find_node(node, "flashFrameDelay")))
+        config_frame_flash_delay = obt_xml_node_int(n);
+    if ((n = obt_xml_find_node(node, "flashFrameDuration")))
+        config_frame_flash_duration = obt_xml_node_int(n);
 
     n = obt_xml_find_node(node, "font");
     while (n) {
@@ -1074,6 +1086,8 @@ void config_startup(ObtXmlInst *i)
     config_title_layout = g_strdup("NLIMC");
     config_theme_keepborder = TRUE;
     config_theme_window_list_icon_size = 36;
+    config_frame_flash_delay = 600;
+    config_frame_flash_duration = 5000;
 
     config_font_activewindow = NULL;
     config_font_inactivewindow = NULL;
index 87662ab9d27955fa86d073d4fef1f6f7c2e8c5ff..c09a1f4f1cfb5335add5a71c4a6cef14eb5a06f6 100644 (file)
@@ -65,8 +65,9 @@ struct _ObAppSettings
     gint max_horz;
     gint max_vert;
     gint fullscreen;
-
     gint layer;
+
+    guint8 opacity;
 };
 
 /*! Should new windows be focused */
@@ -151,6 +152,10 @@ extern gchar *config_title_layout;
 extern gboolean config_animate_iconify;
 /*! Size of icons in focus switching dialogs */
 extern guint config_theme_window_list_icon_size;
+/*! Amount of time between flashes (0 to disable flashing) */
+extern guint config_frame_flash_delay;
+/*! How long (ms) to flash the window's frame (0 to flash forever) */
+extern guint config_frame_flash_duration;
 
 /*! The font for the active window's title */
 extern RrFont *config_font_activewindow;
index 24d3eb535a93ae3f3eaa428298df54585ffefa65..0f2d56ebaf7ce37c6e55c445444f7328afe94ced 100644 (file)
@@ -1674,11 +1674,13 @@ static gboolean flash_timeout(gpointer data)
     ObFrame *self = data;
     GTimeVal now;
 
-    g_get_current_time(&now);
-    if (now.tv_sec > self->flash_end.tv_sec ||
-        (now.tv_sec == self->flash_end.tv_sec &&
-         now.tv_usec >= self->flash_end.tv_usec))
-        self->flashing = FALSE;
+    if (config_frame_flash_duration != 0) {
+        g_get_current_time(&now);
+        if (now.tv_sec > self->flash_end.tv_sec ||
+            (now.tv_sec == self->flash_end.tv_sec &&
+             now.tv_usec >= self->flash_end.tv_usec))
+            self->flashing = FALSE;
+    }
 
     if (!self->flashing)
         return FALSE; /* we are done */
@@ -1694,14 +1696,19 @@ static gboolean flash_timeout(gpointer data)
 
 void frame_flash_start(ObFrame *self)
 {
+    if (config_frame_flash_delay == 0) return;
+
     self->flash_on = self->focused;
 
     if (!self->flashing)
         self->flash_timer = g_timeout_add_full(G_PRIORITY_DEFAULT,
-                                               600, flash_timeout, self,
+                                               config_frame_flash_delay, flash_timeout, self,
                                                flash_done);
-    g_get_current_time(&self->flash_end);
-    g_time_val_add(&self->flash_end, G_USEC_PER_SEC * 5);
+
+    if (config_frame_flash_duration != 0) {
+        g_get_current_time(&self->flash_end);
+        g_time_val_add(&self->flash_end, 1000 * config_frame_flash_duration);
+    }
 
     self->flashing = TRUE;
 }
index 1625ccf01ccddd7aa5d0fc9036ab4c7ed5fdde14..ffed909315037ae4b6882f92b391dbc3b0dc8a7d 100644 (file)
@@ -583,16 +583,16 @@ static void edge_warp_move_ptr(void)
 
     switch (edge_warp_dir) {
        case OB_DIRECTION_NORTH:
-           y = a->height - 1;
+           y = a->height - 2;
            break;
        case OB_DIRECTION_EAST:
-           x = a->x;
+           x = a->x + 1;
            break;
        case OB_DIRECTION_SOUTH:
-           y = a->y;
+           y = a->y + 1;
            break;
        case OB_DIRECTION_WEST:
-           x = a->width - 1;
+           x = a->width - 2;
            break;
        default:
         g_assert_not_reached();
index d6c6f76704f3c73923ba00b354821627b92041d0..1a81b90dbe81ad3546c79f987a379a167866db75 100644 (file)
@@ -583,6 +583,7 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata)
             fprintf(f, "\t<y>%d</y>\n", prey);
             fprintf(f, "\t<width>%d</width>\n", prew);
             fprintf(f, "\t<height>%d</height>\n", preh);
+            fprintf(f, "\t<opacity>%d</opacity>\n", c->opacity);
             if (c->shaded)
                 fprintf(f, "\t<shaded />\n");
             if (c->iconic)
@@ -763,6 +764,9 @@ static void session_load_file(const gchar *path)
         if (!(n = obt_xml_find_node(node->children, "height")))
             goto session_load_bail;
         state->h = obt_xml_node_int(n);
+        if (!(n = obt_xml_find_node(node->children, "opacity")))
+            goto session_load_bail;
+        state->opacity = obt_xml_node_int(n);
 
         state->shaded =
             obt_xml_find_node(node->children, "shaded") != NULL;
index f37e2111710913002d20a10c9b36c06c91e46b61..8cfcb8e71b3c68458d979811145b3daae50dc8c9 100644 (file)
@@ -34,6 +34,7 @@ struct _ObSessionState {
     gboolean shaded, iconic, skip_pager, skip_taskbar, fullscreen;
     gboolean above, below, max_horz, max_vert, undecorated;
     gboolean focused;
+    guint8 opacity;
 
     gboolean matched;
 };
This page took 0.039241 seconds and 4 git commands to generate.