e_client: deprecate some values of icccm in E_Client 45/304445/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 17 Jan 2024 07:50:01 +0000 (16:50 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 17 Jan 2024 09:54:18 +0000 (18:54 +0900)
Change-Id: I9da6dd64bb9384cf937b15a39b0a1717779ebff1

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_object.c
src/bin/e_focus_policy_history.c
src/bin/e_focus_policy_topmost.c
src/bin/e_info_server.c
src/bin/e_zone.c

index 0fb1321..9124e0c 100644 (file)
@@ -981,17 +981,7 @@ _e_client_free(E_Client *ec)
    eina_stringshare_replace(&ec->icccm.class, NULL);
 #endif
    eina_stringshare_replace(&ec->icccm.title, NULL);
-   eina_stringshare_replace(&ec->icccm.icon_name, NULL);
-   eina_stringshare_replace(&ec->icccm.machine, NULL);
    eina_stringshare_replace(&ec->icccm.window_role, NULL);
-   if ((ec->icccm.command.argc > 0) && (ec->icccm.command.argv))
-     {
-        int i;
-
-        for (i = 0; i < ec->icccm.command.argc; i++)
-          free(ec->icccm.command.argv[i]);
-        E_FREE(ec->icccm.command.argv);
-     }
    eina_stringshare_replace(&ec->netwm.name, NULL);
    eina_stringshare_replace(&ec->internal_icon, NULL);
    eina_stringshare_replace(&ec->internal_icon_key, NULL);
@@ -3207,18 +3197,10 @@ e_client_new(E_Pixmap *cp, int first_map, int internal)
 #else
    ec->icccm.class = NULL;
 #endif
-   ec->icccm.icon_name = NULL;
-   ec->icccm.machine = NULL;
    ec->icccm.min_w = 1;
    ec->icccm.min_h = 1;
    ec->icccm.max_w = 32767;
    ec->icccm.max_h = 32767;
-   ec->icccm.base_w = 0;
-   ec->icccm.base_h = 0;
-   ec->icccm.step_w = -1;
-   ec->icccm.step_h = -1;
-   ec->icccm.min_aspect = 0.0;
-   ec->icccm.max_aspect = 0.0;
 
    ec->netwm.pid = 0;
    ec->netwm.name = NULL;
@@ -4059,7 +4041,6 @@ e_client_focused_set(E_Client *ec)
             if (e_object_ref_get(E_OBJECT(focused_ec)) > 0)
               {
                  _e_client_event_simple(focused_ec, E_EVENT_CLIENT_FOCUS_OUT);
-                 e_client_urgent_set(focused_ec, focused_ec->icccm.urgent);
               }
          }
      }
@@ -4450,27 +4431,6 @@ EINTERN Eina_Bool e_client_hide_by_request_get(E_Client *ec)
    return priv->hide_by_request;
 }
 
-EINTERN void
-e_client_urgent_set(E_Client *ec, Eina_Bool urgent)
-{
-   E_OBJECT_CHECK(ec);
-   E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
-
-   urgent = !!urgent;
-   if (urgent == ec->urgent) return;
-   _e_client_event_property(ec, E_CLIENT_PROPERTY_URGENCY);
-   if (urgent && (!ec->focused) && (!ec->want_focus))
-     {
-        e_comp_object_signal_emit(ec->frame, "e,state,urgent", "e");
-        ec->urgent = urgent;
-     }
-   else
-     {
-        e_comp_object_signal_emit(ec->frame, "e,state,not_urgent", "e");
-        ec->urgent = 0;
-     }
-}
-
 ///////////////////////////////////////
 
 EINTERN void
@@ -4940,84 +4900,13 @@ e_client_signal_resize_end(E_Client *ec, const char *dir EINA_UNUSED, const char
 EINTERN void
 e_client_resize_limit(E_Client *ec, int *w, int *h)
 {
-   double a;
-   Eina_Bool inc_h;
-
    E_OBJECT_CHECK(ec);
    E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
 
-   inc_h = (*h - ec->h > 0);
    if (ec->frame)
      e_comp_object_frame_wh_unadjust(ec->frame, *w, *h, w, h);
    if (*h < 1) *h = 1;
    if (*w < 1) *w = 1;
-   if ((ec->icccm.base_w >= 0) &&
-       (ec->icccm.base_h >= 0))
-     {
-        int tw, th;
-
-        tw = *w - ec->icccm.base_w;
-        th = *h - ec->icccm.base_h;
-        if (tw < 1) tw = 1;
-        if (th < 1) th = 1;
-        a = (double)(tw) / (double)(th);
-        if ((ec->icccm.min_aspect != 0.0) &&
-            (a < ec->icccm.min_aspect))
-          {
-             if (inc_h)
-               tw = th * ec->icccm.min_aspect;
-             else
-               th = tw / ec->icccm.max_aspect;
-             *w = tw + ec->icccm.base_w;
-             *h = th + ec->icccm.base_h;
-          }
-        else if ((ec->icccm.max_aspect != 0.0) &&
-                 (a > ec->icccm.max_aspect))
-          {
-             tw = th * ec->icccm.max_aspect;
-             *w = tw + ec->icccm.base_w;
-          }
-     }
-   else
-     {
-        a = (double)*w / (double)*h;
-        if ((ec->icccm.min_aspect != 0.0) &&
-            (a < ec->icccm.min_aspect))
-          {
-             if (inc_h)
-               *w = *h * ec->icccm.min_aspect;
-             else
-               *h = *w / ec->icccm.min_aspect;
-          }
-        else if ((ec->icccm.max_aspect != 0.0) &&
-                 (a > ec->icccm.max_aspect))
-          *w = *h * ec->icccm.max_aspect;
-     }
-   if (ec->icccm.step_w > 0)
-     {
-        if (ec->icccm.base_w >= 0)
-          *w = ec->icccm.base_w +
-            (((*w - ec->icccm.base_w) / ec->icccm.step_w) *
-             ec->icccm.step_w);
-        else
-          *w = ec->icccm.min_w +
-            (((*w - ec->icccm.min_w) / ec->icccm.step_w) *
-             ec->icccm.step_w);
-     }
-   if (ec->icccm.step_h > 0)
-     {
-        if (ec->icccm.base_h >= 0)
-          *h = ec->icccm.base_h +
-            (((*h - ec->icccm.base_h) / ec->icccm.step_h) *
-             ec->icccm.step_h);
-        else
-          *h = ec->icccm.min_h +
-            (((*h - ec->icccm.min_h) / ec->icccm.step_h) *
-             ec->icccm.step_h);
-     }
-
-   if (*h < 1) *h = 1;
-   if (*w < 1) *w = 1;
 
    if ((ec->icccm.max_w > 0) && (*w > ec->icccm.max_w)) *w = ec->icccm.max_w;
    else if (*w < ec->icccm.min_w)
index c280ca0..3588109 100644 (file)
@@ -466,43 +466,43 @@ struct E_Client
 #else
       Eina_Stringshare        *class;
 #endif
-      Eina_Stringshare        *icon_name;
-      Eina_Stringshare        *machine;
+      EINA_DEPRECATED Eina_Stringshare        *icon_name;
+      EINA_DEPRECATED Eina_Stringshare        *machine;
       int                       min_w, min_h;
       int                       max_w, max_h;
-      int                       base_w, base_h;
-      int                       step_w, step_h;
-      int                       start_x, start_y;
-      double                    min_aspect, max_aspect;
-      Ecore_Window            icon_window;
-      Ecore_Window            window_group;
+      EINA_DEPRECATED int                       base_w, base_h;
+      EINA_DEPRECATED int                       step_w, step_h;
+      EINA_DEPRECATED int                       start_x, start_y;
+      EINA_DEPRECATED double                    min_aspect, max_aspect;
+      EINA_DEPRECATED Ecore_Window            icon_window;
+      EINA_DEPRECATED Ecore_Window            window_group;
       Ecore_Window            transient_for;
-      Ecore_Window            client_leader;
+      EINA_DEPRECATED Ecore_Window            client_leader;
       Eina_Stringshare         *window_role;
       unsigned char             take_focus : 1;
       unsigned char             accepts_focus : 1;
-      unsigned char             urgent : 1;
+      EINA_DEPRECATED unsigned char             urgent : 1;
       unsigned char             delete_request : 1;
-      unsigned char             request_pos : 1;
-      struct
+      EINA_DEPRECATED unsigned char             request_pos : 1;
+      EINA_DEPRECATED struct
       {
          int    argc;
          char **argv;
       } command;
       struct
       {
-         unsigned char title : 1;
-         unsigned char name_class : 1;
-         unsigned char icon_name : 1;
-         unsigned char machine : 1;
-         unsigned char hints : 1;
-         unsigned char size_pos_hints : 1;
-         unsigned char protocol : 1;
+         EINA_DEPRECATED unsigned char title : 1;
+         EINA_DEPRECATED unsigned char name_class : 1;
+         EINA_DEPRECATED unsigned char icon_name : 1;
+         EINA_DEPRECATED unsigned char machine : 1;
+         EINA_DEPRECATED unsigned char hints : 1;
+         EINA_DEPRECATED unsigned char size_pos_hints : 1;
+         EINA_DEPRECATED unsigned char protocol : 1;
          unsigned char transient_for : 1;
-         unsigned char client_leader : 1;
-         unsigned char window_role : 1;
-         unsigned char state : 1;
-         unsigned char command : 1;
+         EINA_DEPRECATED unsigned char client_leader : 1;
+         EINA_DEPRECATED unsigned char window_role : 1;
+         EINA_DEPRECATED unsigned char state : 1;
+         EINA_DEPRECATED unsigned char command : 1;
       } fetch;
    } icccm;
 
@@ -1126,7 +1126,6 @@ EINTERN E_Iconified_Type e_client_iconified_type_get(E_Client *ec);
 E_API Eina_Bool e_client_is_iconified_by_client(E_Client *ec);
 EINTERN void e_client_hide_by_request_set(E_Client *ec, Eina_Bool set);
 EINTERN Eina_Bool e_client_hide_by_request_get(E_Client *ec);
-EINTERN void e_client_urgent_set(E_Client *ec, Eina_Bool urgent);
 EINTERN void e_client_stick(E_Client *ec);
 EINTERN void e_client_unstick(E_Client *ec);
 EINTERN void e_client_pinned_set(E_Client *ec, Eina_Bool set);
index 4af04fd..e76afa0 100644 (file)
@@ -1000,7 +1000,7 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
    E_Input_Rect_Smart_Data *input_rect_sd;
    E_Comp_Match *m;
    Eina_Stringshare *reshadow_group = NULL;
-   Eina_Bool focus = EINA_FALSE, urgent = EINA_FALSE, skip = EINA_FALSE, fast = EINA_FALSE, reshadow = EINA_FALSE, no_shadow = EINA_FALSE, pass_event_flag = EINA_FALSE;
+   Eina_Bool focus = EINA_FALSE, skip = EINA_FALSE, fast = EINA_FALSE, reshadow = EINA_FALSE, no_shadow = EINA_FALSE, pass_event_flag = EINA_FALSE;
    Eina_Stringshare *name, *title;
    E_Comp_Config *conf = e_comp_config_get();
 
@@ -1023,7 +1023,6 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
              if (!_e_comp_object_shadow_client_match(cw->ec, m)) continue;
 
              focus = m->focus;
-             urgent = m->urgent;
              no_shadow = m->no_shadow;
              if (m->shadow_style)
                {
@@ -1120,10 +1119,6 @@ _e_comp_object_shadow_setup(E_Comp_Object *cw)
      e_comp_object_signal_emit(cw->smart_obj, "e,state,focused", "e");
    else
      e_comp_object_signal_emit(cw->smart_obj, "e,state,unfocused", "e");
-   if (urgent || cw->ec->urgent)
-     e_comp_object_signal_emit(cw->smart_obj, "e,state,urgent", "e");
-   else
-     e_comp_object_signal_emit(cw->smart_obj, "e,state,not_urgent", "e");
    if (cw->ec->sticky)
      e_comp_object_signal_emit(cw->smart_obj, "e,state,sticky", "e");
    if (cw->ec->hung)
index bfb660d..e976452 100644 (file)
@@ -555,7 +555,6 @@ _focus_policy_history_cb_client_focus_set(struct wl_listener *listener, void *da
    zone = history_policy->zone;
 
    ec->focused = 1;
-   e_client_urgent_set(ec, 0);
 
    // TODO: This is not for focus policy, but for fullscreen(Window State) policy.
    //       Move this code to the better place.
index 7d87a57..f231476 100644 (file)
@@ -294,7 +294,6 @@ _focus_policy_topmost_cb_client_focus_set(struct wl_listener *listener, void *da
    zone = topmost_policy->zone;
 
    ec->focused = 1;
-   e_client_urgent_set(ec, 0);
 
    // TODO: This is not for focus policy, but for fullscreen(Window State) policy.
    //       Move this code to the better place.
index e5c190e..9ada754 100644 (file)
@@ -1678,30 +1678,6 @@ _get_win_prop_Fullscreen(const Evas_Object *evas_obj)
 }
 
 static const char*
-_set_win_prop_Urgent(Evas_Object *evas_obj, const char *prop_value)
-{
-   E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
-
-   if(strstr(prop_value, "TRUE"))
-     e_client_urgent_set(ec, EINA_TRUE);
-   else if(strstr(prop_value, "FALSE"))
-     e_client_urgent_set(ec, EINA_FALSE);
-   else
-     return strdup("invalid property value");
-
-   return NULL;
-}
-
-static const char*
-_get_win_prop_Urgent(const Evas_Object *evas_obj)
-{
-   const E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
-   return ec->urgent ? strdup("TRUE") : strdup("FALSE");
-}
-
-static const char*
 _set_win_prop_Sticky(Evas_Object *evas_obj, const char *prop_value)
 {
    E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
@@ -2327,11 +2303,6 @@ static struct property_manager
         _set_win_prop_Sticky
     },
     {
-        "Urgent",
-        _get_win_prop_Urgent,
-        _set_win_prop_Urgent
-    },
-    {
         "Fullscreen",
         _get_win_prop_Fullscreen,
         _set_win_prop_Fullscreen
index 976e3eb..e0ba701 100644 (file)
@@ -617,7 +617,6 @@ _zone_cb_client_iconify(struct wl_listener *listener, void *data)
      desk->fullscreen_clients = eina_list_remove(desk->fullscreen_clients, ec);
    e_client_comp_hidden_set(ec, 1);
    evas_object_hide(ec->frame);
-   e_client_urgent_set(ec, ec->icccm.urgent);
 
    e_client_iconify_event_send(ec);