[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request 115396: fix handling of window size hints with PResizeInc
From:       Martin_Gräßlin <mgraesslin () kde ! org>
Date:       2014-01-30 11:30:08
Message-ID: 20140130113008.32672.87162 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115396/#review48596
-----------------------------------------------------------


I tried to create a test application demonstrating the behavior using the values from \
https://bugzilla.gnome.org/attachment.cgi?id=193285 but with pure xcb, KWin/5 does \
not show this problem.

It would probably help if I could see the xprop of the affected windows. \
Unfortunately I don't have any gtk development environment set up, so I cannot just \
test myself.

For reference the test code I used:
#include <stdlib.h>
#include <xcb/xcb.h>
#include <xcb/xcb_icccm.h>

int main(int, char **)
{
    int screenNumber;
    xcb_connection_t *c = xcb_connect(nullptr, &screenNumber);

    auto getScreen = [=]() {
        const xcb_setup_t *setup = xcb_get_setup(c);
        auto it = xcb_setup_roots_iterator (setup);
        for (int i = 0; i < screenNumber; ++i) {
            xcb_screen_next(&it);
        }
        return it.data;
    };
    xcb_screen_t *screen = getScreen();

    xcb_window_t w = xcb_generate_id(c);
    const uint32_t values[2] = {screen->white_pixel, XCB_EVENT_MASK_BUTTON_PRESS | \
XCB_EVENT_MASK_BUTTON_RELEASE};

    xcb_create_window(c, 0, w, screen->root, 0, 0, 80, 36, 0, \
                XCB_WINDOW_CLASS_INPUT_OUTPUT,
                      screen->root_visual, XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, \
values);

    // set the normal hints
    xcb_size_hints_t hints;
    hints.flags = XCB_ICCCM_SIZE_HINT_P_MIN_SIZE | XCB_ICCCM_SIZE_HINT_BASE_SIZE | \
XCB_ICCCM_SIZE_HINT_P_RESIZE_INC;  hints.min_width = 8;
    hints.min_height = 15;
    hints.base_width = 0;
    hints.base_height = 0;
    hints.width_inc = 8;
    hints.height_inc = 15;
    xcb_icccm_set_wm_normal_hints(c, w, &hints);

    // and map the window
    xcb_map_window(c, w);
    xcb_flush(c);

    while (xcb_generic_event_t *event = xcb_wait_for_event(c)) {
        bool exit = false;
        if ((event->response_type & ~0x80) == XCB_BUTTON_RELEASE) {
            exit = true;
        }
        free(event);
        if (exit) {
            break;
        }
    }

    xcb_disconnect(c);
    return 0;
}


- Martin Gräßlin


On Jan. 30, 2014, 6:56 a.m., Marek Marczykowski-Górecki wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115396/
> -----------------------------------------------------------
> 
> (Updated Jan. 30, 2014, 6:56 a.m.)
> 
> 
> Review request for kwin.
> 
> 
> Repository: kde-workspace
> 
> 
> Description
> -------
> 
> Use base_width/base_height if provided by the application and fallback to \
> min_width/min_height only if not (according to ICCCM 4.1.2.3). Previously always \
> min_width/min_height was used (if provided), even if base_width/base_height was \
> also provided. 
> This fixes long standing bug with shrinking gnome-terminal window. Haven't found it \
> in KDE Bugs, but described here: https://bugzilla.redhat.com/show_bug.cgi?id=707664 \
>  
> Diffs
> -----
> 
> kwin/geometry.cpp 6ae9666 
> 
> Diff: https://git.reviewboard.kde.org/r/115396/diff/
> 
> 
> Testing
> -------
> 
> Tested patched kde-workspace-4.10.5 (Fedora 18), I don't any significant changes \
> until now. Patched version allows normal gnome-terminal use, previously it was \
> shrinking to minimal size. 
> 
> Thanks,
> 
> Marek Marczykowski-Górecki
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/115396/">https://git.reviewboard.kde.org/r/115396/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I tried to create a test \
application demonstrating the behavior using the values from \
https://bugzilla.gnome.org/attachment.cgi?id=193285 but with pure xcb, KWin/5 does \
not show this problem.

It would probably help if I could see the xprop of the affected windows. \
Unfortunately I don&#39;t have any gtk development environment set up, so I cannot \
just test myself.

For reference the test code I used:
#include &lt;stdlib.h&gt;
#include &lt;xcb/xcb.h&gt;
#include &lt;xcb/xcb_icccm.h&gt;

int main(int, char **)
{
    int screenNumber;
    xcb_connection_t *c = xcb_connect(nullptr, &amp;screenNumber);

    auto getScreen = [=]() {
        const xcb_setup_t *setup = xcb_get_setup(c);
        auto it = xcb_setup_roots_iterator (setup);
        for (int i = 0; i &lt; screenNumber; ++i) {
            xcb_screen_next(&amp;it);
        }
        return it.data;
    };
    xcb_screen_t *screen = getScreen();

    xcb_window_t w = xcb_generate_id(c);
    const uint32_t values[2] = {screen-&gt;white_pixel, XCB_EVENT_MASK_BUTTON_PRESS | \
XCB_EVENT_MASK_BUTTON_RELEASE};

    xcb_create_window(c, 0, w, screen-&gt;root, 0, 0, 80, 36, 0, \
                XCB_WINDOW_CLASS_INPUT_OUTPUT,
                      screen-&gt;root_visual, XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, \
values);

    // set the normal hints
    xcb_size_hints_t hints;
    hints.flags = XCB_ICCCM_SIZE_HINT_P_MIN_SIZE | XCB_ICCCM_SIZE_HINT_BASE_SIZE | \
XCB_ICCCM_SIZE_HINT_P_RESIZE_INC;  hints.min_width = 8;
    hints.min_height = 15;
    hints.base_width = 0;
    hints.base_height = 0;
    hints.width_inc = 8;
    hints.height_inc = 15;
    xcb_icccm_set_wm_normal_hints(c, w, &amp;hints);

    // and map the window
    xcb_map_window(c, w);
    xcb_flush(c);

    while (xcb_generic_event_t *event = xcb_wait_for_event(c)) {
        bool exit = false;
        if ((event-&gt;response_type &amp; ~0x80) == XCB_BUTTON_RELEASE) {
            exit = true;
        }
        free(event);
        if (exit) {
            break;
        }
    }

    xcb_disconnect(c);
    return 0;
}
</pre>
 <br />









<p>- Martin Gräßlin</p>


<br />
<p>On January 30th, 2014, 6:56 a.m. CET, Marek Marczykowski-Górecki wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin.</div>
<div>By Marek Marczykowski-Górecki.</div>


<p style="color: grey;"><i>Updated Jan. 30, 2014, 6:56 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-workspace
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Use base_width/base_height if provided by the application and fallback \
to min_width/min_height only if not (according to ICCCM 4.1.2.3). Previously always \
min_width/min_height was used (if provided), even if base_width/base_height was also \
provided.

This fixes long standing bug with shrinking gnome-terminal window. Haven&#39;t found \
it in KDE Bugs, but described here: \
https://bugzilla.redhat.com/show_bug.cgi?id=707664</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Tested patched kde-workspace-4.10.5 (Fedora 18), I don&#39;t any \
significant changes until now. Patched version allows normal gnome-terminal use, \
previously it was shrinking to minimal size.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kwin/geometry.cpp <span style="color: grey">(6ae9666)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/115396/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic