From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: GTK scroll bar question Date: Thu, 31 Jul 2014 08:52:48 +0200 Message-ID: <53D9E7C0.9040204@swipnet.se> References: <53D8D2DE.4090700@yandex.ru> <53D8E765.2030303@gmx.at> <53D91162.9010503@yandex.ru> <53D9CE87.20800@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1406789602 29877 80.91.229.3 (31 Jul 2014 06:53:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jul 2014 06:53:22 +0000 (UTC) Cc: Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 31 08:53:15 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XCkEj-0008Qc-U1 for ged-emacs-devel@m.gmane.org; Thu, 31 Jul 2014 08:53:14 +0200 Original-Received: from localhost ([::1]:54629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCkEh-0003yH-HN for ged-emacs-devel@m.gmane.org; Thu, 31 Jul 2014 02:53:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCkEX-0003yA-Mf for emacs-devel@gnu.org; Thu, 31 Jul 2014 02:53:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCkEQ-00050A-69 for emacs-devel@gnu.org; Thu, 31 Jul 2014 02:53:01 -0400 Original-Received: from mailfe03.swip.net ([212.247.154.65]:53104 helo=swip.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCkEP-0004zv-Vh for emacs-devel@gnu.org; Thu, 31 Jul 2014 02:52:54 -0400 X-T2-Spam-Status: No, hits=0.0 required=5.0 Original-Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 353256071; Thu, 31 Jul 2014 08:52:51 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <53D9CE87.20800@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.247.154.65 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173308 Archived-At: Dmitry Antipov skrev 2014-07-31 07:05: > On 07/30/2014 10:30 PM, Jan Djärv wrote: > >> This: >> >> + /* Realize so we can ask for underlying resources. */ >> + gtk_widget_realize (wscroll); >> is a noop on newer Gtk+ versions. > > Hm...in this particular case, adding or removing call to gtk_widget_realize > doesn't change anything; but, looking through source code of this function, > it's hard to believe that this is just another version of do { } while (0). > >> Scrollbars does not have their own X window, they write on the parent >> window. > > Is it legitimate to use Window id (of scroll bar or it's parent) > returned by > > gdk_x11_window_get_xid (gtk_widget_get_window (...)) > No, it never is. BTW, there may be many scroll bars on the same parent (many windows in a frame), so the mapping is not unique. You should at all possible cost avoid map a Gtk+ widget to some X window. It might have an X window now, but that might change. Also, porting to stuff like Cairo or other Gtk+ backends is so much more difficult (Cairo is a possibility, other backends less so). So find another way of doing whatever you are trying to do tha does not involve X at all, just Gtk+. > in x_window_to_[whatever] functions from xterm.c? If yes, there is a > simple > way to get rid of id_to_widget map, as I've tried in attached patch. > Why do you insist in changing stuff that work? Stop that. Jan D.