<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.xfce.org/extern.php?action=feed&amp;tid=6238&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Xfce Forums / Closing windows with middle mouse button]]></title>
		<link>http://forum.xfce.org/viewtopic.php?id=6238</link>
		<description><![CDATA[The most recent posts in Closing windows with middle mouse button.]]></description>
		<lastBuildDate>Tue, 25 Dec 2012 15:41:15 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=28380#p28380</link>
			<description><![CDATA[<p>I&#039;m very glad to see usefull and complete patch about it here: <a href="https://bugzilla.xfce.org/show_bug.cgi?id=8096" rel="nofollow">https://bugzilla.xfce.org/show_bug.cgi?id=8096</a></p><p>Hope this feature will be included in new releases.</p>]]></description>
			<author><![CDATA[dummy@example.com (RPG)]]></author>
			<pubDate>Tue, 25 Dec 2012 15:41:15 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=28380#p28380</guid>
		</item>
		<item>
			<title><![CDATA[Re: Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=26879#p26879</link>
			<description><![CDATA[<p>Thank you so very much!<br />I have been thinking the exact same thing for the last couple weeks,<br />but never got around opening a feature request.</p>]]></description>
			<author><![CDATA[dummy@example.com (Ancurio)]]></author>
			<pubDate>Thu, 05 Jul 2012 22:51:10 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=26879#p26879</guid>
		</item>
		<item>
			<title><![CDATA[Re: Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=26742#p26742</link>
			<description><![CDATA[<p>See <a href="https://bugzilla.xfce.org/show_bug.cgi?id=8096" rel="nofollow">https://bugzilla.xfce.org/show_bug.cgi?id=8096</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Wakope)]]></author>
			<pubDate>Mon, 18 Jun 2012 08:32:28 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=26742#p26742</guid>
		</item>
		<item>
			<title><![CDATA[Re: Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=26065#p26065</link>
			<description><![CDATA[<p>RPG thanks! Please file a bug, and post the bug number here. This is a small feature that should be implemented!</p>]]></description>
			<author><![CDATA[dummy@example.com (soleen)]]></author>
			<pubDate>Wed, 02 May 2012 03:37:19 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=26065#p26065</guid>
		</item>
		<item>
			<title><![CDATA[Re: Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=25961#p25961</link>
			<description><![CDATA[<p>Thank you! <img src="http://forum.xfce.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (putti)]]></author>
			<pubDate>Fri, 27 Apr 2012 10:47:11 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=25961#p25961</guid>
		</item>
		<item>
			<title><![CDATA[Closing windows with middle mouse button]]></title>
			<link>http://forum.xfce.org/viewtopic.php?pid=22774#p22774</link>
			<description><![CDATA[<p>I often open multiple windows, but do not use the grouping of windows, because it&#039;s inconvenient for me. To close multiple windows, I have to right click on each window and look out there &quot;Close&quot;.<br />Many browsers (firefox, chrome) use the middle mouse button for closing tabs. It is very convenient and can be used to close the windows. However, xfce does not provide this features and I decided to add it.</p><p>I found in <strong>tasklist-widget.c</strong> this part of code:</p><div class="codebox"><pre class="vscroll"><code>static gboolean
xfce_tasklist_button_button_press_event (GtkWidget         *button,
                                         GdkEventButton    *event,
                                         XfceTasklistChild *child)
{
  GtkWidget *menu, *panel_plugin;

  panel_return_val_if_fail (XFCE_IS_TASKLIST (child-&gt;tasklist), FALSE);
  panel_return_val_if_fail (child-&gt;type != CHILD_TYPE_GROUP, FALSE);

  if (event-&gt;type != GDK_BUTTON_PRESS
      || xfce_taskbar_is_locked (child-&gt;tasklist))
    return FALSE;

  /* send the event to the panel plugin if control is pressed */
  if (PANEL_HAS_FLAG (event-&gt;state, GDK_CONTROL_MASK))
    {
      /* send the event to the panel plugin */
      panel_plugin = xfce_tasklist_get_panel_plugin (child-&gt;tasklist);
      if (G_LIKELY (panel_plugin != NULL))
        gtk_widget_event (panel_plugin, (GdkEvent *) event);

      return TRUE;
    }

  if (event-&gt;button == 1)
    {
      xfce_tasklist_button_activate (child, event-&gt;time);

      return TRUE;
    }
  else if (event-&gt;button == 3)
    {
      menu = wnck_action_menu_new (child-&gt;window);
      g_signal_connect (G_OBJECT (menu), &quot;selection-done&quot;,
          G_CALLBACK (gtk_widget_destroy), NULL);

      gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
      gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
                      xfce_panel_plugin_position_menu,
                      xfce_tasklist_get_panel_plugin (child-&gt;tasklist),
                      event-&gt;button,
                      event-&gt;time);

      return TRUE;
    }

  return FALSE;
}</code></pre></div><p>This part handles clicking on the taskbar. This code i replaced on this:</p><div class="codebox"><pre class="vscroll"><code>static gboolean
xfce_tasklist_button_button_press_event (GtkWidget         *button,
                                         GdkEventButton    *event,
                                         XfceTasklistChild *child)
{
  GtkWidget *menu, *panel_plugin;

  panel_return_val_if_fail (XFCE_IS_TASKLIST (child-&gt;tasklist), FALSE);
  panel_return_val_if_fail (child-&gt;type != CHILD_TYPE_GROUP, FALSE);

  if (event-&gt;type != GDK_BUTTON_PRESS
      || xfce_taskbar_is_locked (child-&gt;tasklist))
    return FALSE;

  /* send the event to the panel plugin if control is pressed */
  if (PANEL_HAS_FLAG (event-&gt;state, GDK_CONTROL_MASK))
    {
      /* send the event to the panel plugin */
      panel_plugin = xfce_tasklist_get_panel_plugin (child-&gt;tasklist);
      if (G_LIKELY (panel_plugin != NULL))
        gtk_widget_event (panel_plugin, (GdkEvent *) event);

      return TRUE;
    }

  if (event-&gt;button == 1)
    {
      xfce_tasklist_button_activate (child, event-&gt;time);

      return TRUE;
    }
  else if (event-&gt;button == 2)
  {
    wnck_window_close (child-&gt;window, gtk_get_current_event_time ());
    return TRUE;
  }
  else if (event-&gt;button == 3)
    {
      menu = wnck_action_menu_new (child-&gt;window);
      g_signal_connect (G_OBJECT (menu), &quot;selection-done&quot;,
          G_CALLBACK (gtk_widget_destroy), NULL);

      gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
      gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
                      xfce_panel_plugin_position_menu,
                      xfce_tasklist_get_panel_plugin (child-&gt;tasklist),
                      event-&gt;button,
                      event-&gt;time);

      return TRUE;
    }

  return FALSE;
}</code></pre></div><p>re-compile tasklist-plugin and enjoy:)</p><p>I hope to see this feature in next XFCE releases.</p>]]></description>
			<author><![CDATA[dummy@example.com (RPG)]]></author>
			<pubDate>Sun, 21 Aug 2011 18:02:12 +0000</pubDate>
			<guid>http://forum.xfce.org/viewtopic.php?pid=22774#p22774</guid>
		</item>
	</channel>
</rss>
